Skip to content

Commit 52f6531

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 606770f + a24b371 commit 52f6531

16 files changed

+67
-68
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Other ways of triggering a time travel are available if a [Time Circuits Display
267267

268268
## SD card
269269

270-
Preface note on SD cards: For unknown reasons, some SD cards simply do not work with this device. For instance, I had no luck with Sandisk Ultra 32GB and "Intenso" cards. If your SD card is not recognized, check if it is formatted in FAT32 format (not exFAT!). Also, the size must not exceed 32GB (as larger cards cannot be formatted with FAT32). Transcend SDHC cards and those work fine in my experience.
270+
Preface note on SD cards: For unknown reasons, some SD cards simply do not work with this device. For instance, I had no luck with Sandisk Ultra 32GB and "Intenso" cards. If your SD card is not recognized, check if it is formatted in FAT32 format (not exFAT!). Also, the size must not exceed 32GB (as larger cards cannot be formatted with FAT32). Transcend SDHC cards work fine in my experience.
271271

272272
The SD card, apart from being required for [installing](#audio-data-installation) of the built-in audio data, can be used for substituting built-in sound effects and for music played back by the [Music player](#the-music-player). Also, it is _strongly recommended_ to store [secondary settings](#-save-secondary-settings-on-sd) on the SD card to minimize [Flash Wear](#flash-wear).
273273

-112 Bytes
Binary file not shown.

src/dashgauges-A10001986.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* -------------------------------------------------------------------
33
* Dash Gauges Panel
4-
* (C) 2023-2024 Thomas Winischhofer (A10001986)
4+
* (C) 2023-2025 Thomas Winischhofer (A10001986)
55
* https://github.com/realA10001986/Dash-Gauges
66
* https://dg.out-a-ti.me
77
*
@@ -115,6 +115,10 @@
115115

116116
/* Changelog
117117
*
118+
* 2025/01/13 (A10001986) [1.12]
119+
* - BTTFN: Minor code optimization
120+
* 2024/10/27 (A10001986)
121+
* - Minor changes
118122
* 2024/10/26 (A10001986) [1.10]
119123
* - Add support for TCD multicast notifications: This brings more immediate speed
120124
* updates (no more polling; TCD sends out speed info when appropriate), and

src/dg_audio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* -------------------------------------------------------------------
33
* Dash Gauges Panel
4-
* (C) 2023-2024 Thomas Winischhofer (A10001986)
4+
* (C) 2023-2025 Thomas Winischhofer (A10001986)
55
* https://github.com/realA10001986/Dash-Gauges
66
* https://dg.out-a-ti.me
77
*

src/dg_audio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* -------------------------------------------------------------------
33
* Dash Gauges Panel
4-
* (C) 2023-2024 Thomas Winischhofer (A10001986)
4+
* (C) 2023-2025 Thomas Winischhofer (A10001986)
55
* https://github.com/realA10001986/Dash-Gauges
66
* https://dg.out-a-ti.me
77
*

src/dg_global.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* -------------------------------------------------------------------
33
* Dash Gauges Panel
4-
* (C) 2023-2024 Thomas Winischhofer (A10001986)
4+
* (C) 2023-2025 Thomas Winischhofer (A10001986)
55
* https://github.com/realA10001986/Dash-Gauges
66
* https://dg.out-a-ti.me
77
*
@@ -15,8 +15,8 @@
1515
*** Version Strings ***
1616
*************************************************************************/
1717

18-
#define DG_VERSION "V1.10"
19-
#define DG_VERSION_EXTRA "OCT262024"
18+
#define DG_VERSION "V1.12"
19+
#define DG_VERSION_EXTRA "JAN132025"
2020

2121
//#define DG_DBG // debug output on Serial
2222

src/dg_main.cpp

Lines changed: 45 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* -------------------------------------------------------------------
33
* Dash Gauges Panel
4-
* (C) 2023-2024 Thomas Winischhofer (A10001986)
4+
* (C) 2023-2025 Thomas Winischhofer (A10001986)
55
* https://github.com/realA10001986/Dash-Gauges
66
* https://dg.out-a-ti.me
77
*
@@ -313,6 +313,7 @@ static uint8_t bttfnReqStatus = 0x52; // Request capabilities, status, spe
313313
static uint32_t tcdHostNameHash = 0;
314314
static byte BTTFMCBuf[BTTF_PACKET_SIZE];
315315
static uint8_t bttfnMcMarker = 0;
316+
static IPAddress bttfnMcIP(224, 0, 0, 224);
316317
#endif
317318

318319
static int iCmdIdx = 0;
@@ -386,7 +387,8 @@ static bool bttfn_checkmc();
386387
static void BTTFNCheckPacket();
387388
static bool BTTFNTriggerUpdate();
388389
static void BTTFNSendPacket();
389-
static bool BTTFNTriggerTT();
390+
391+
static bool bttfn_trigger_tt();
390392

391393
// Boot
392394

@@ -859,7 +861,7 @@ void main_loop()
859861
if(TCDconnected) {
860862
ssEnd();
861863
}
862-
if(TCDconnected || !bttfnTT || !BTTFNTriggerTT()) {
864+
if(TCDconnected || !bttfnTT || !bttfn_trigger_tt()) {
863865
timeTravel(TCDconnected, noETTOLead ? 0 : ETTO_LEAD);
864866
}
865867
}
@@ -1099,6 +1101,8 @@ void main_loop()
10991101
if(atoi(settings.playALsnd) > 0) {
11001102
play_file("/alarm.mp3", PA_INTRMUS|PA_ALLOWSD|PA_DYNVOL, 1.0);
11011103
}
1104+
// No special handling for !FPBUnitIsOn needed, when
1105+
// special signal ends, it restores the old state
11021106
emptyLED.specialSignal(DGSEQ_ALARM);
11031107
}
11041108

@@ -2030,7 +2034,7 @@ static void bttfn_setup()
20302034

20312035
#ifdef BTTFN_MC
20322036
dgMcUDP = &bttfMcUDP;
2033-
dgMcUDP->beginMulticast(IPAddress(224, 0, 0, 224), BTTF_DEFAULT_LOCAL_PORT + 2);
2037+
dgMcUDP->beginMulticast(bttfnMcIP, BTTF_DEFAULT_LOCAL_PORT + 2);
20342038
#endif
20352039

20362040
BTTFNfailCount = 0;
@@ -2129,8 +2133,7 @@ static void handle_tcd_notification(uint8_t *buf)
21292133
addCmdQueue(1000000);
21302134
break;
21312135
case BTTFN_NOT_PCG_CMD:
2132-
addCmdQueue( buf[6] | (buf[7] << 8) |
2133-
(buf[8] | (buf[9] << 8)) << 16);
2136+
addCmdQueue(GET32(buf, 6));
21342137
break;
21352138
case BTTFN_NOT_WAKEUP:
21362139
if(!TTrunning) {
@@ -2318,43 +2321,35 @@ static bool BTTFNTriggerUpdate()
23182321
return true;
23192322
}
23202323

2321-
static void BTTFNSendPacket()
2322-
{
2324+
static void BTTFNPreparePacket()
2325+
{
23232326
memset(BTTFUDPBuf, 0, BTTF_PACKET_SIZE);
23242327

23252328
// ID
23262329
memcpy(BTTFUDPBuf, BTTFUDPHD, 4);
23272330

2328-
// Serial
2329-
BTTFUDPID = (uint32_t)millis();
2330-
SET32(BTTFUDPBuf, 6, BTTFUDPID);
2331-
23322331
// Tell the TCD about our hostname (0-term., 13 bytes total)
23332332
strncpy((char *)BTTFUDPBuf + 10, settings.hostName, 12);
23342333
BTTFUDPBuf[10+12] = 0;
23352334

23362335
BTTFUDPBuf[10+13] = BTTFN_TYPE_PCG;
23372336

2337+
// Version, MC-marker
23382338
#ifdef BTTFN_MC
2339-
BTTFUDPBuf[4] = BTTFN_VERSION | bttfnMcMarker; // Version, MC-marker
2339+
BTTFUDPBuf[4] = BTTFN_VERSION | bttfnMcMarker;
23402340
#else
23412341
BTTFUDPBuf[4] = BTTFN_VERSION;
2342-
#endif
2343-
BTTFUDPBuf[5] = bttfnReqStatus; // Request status and speed
2344-
2345-
#ifdef BTTFN_MC
2346-
if(!haveTCDIP) {
2347-
BTTFUDPBuf[5] |= 0x80;
2348-
SET32(BTTFUDPBuf, 31, tcdHostNameHash);
2349-
}
2350-
#endif
2342+
#endif
2343+
}
23512344

2345+
static void BTTFNDispatch()
2346+
{
23522347
uint8_t a = 0;
23532348
for(int i = 4; i < BTTF_PACKET_SIZE - 1; i++) {
23542349
a += BTTFUDPBuf[i] ^ 0x55;
23552350
}
23562351
BTTFUDPBuf[BTTF_PACKET_SIZE - 1] = a;
2357-
2352+
23582353
#ifdef BTTFN_MC
23592354
if(haveTCDIP) {
23602355
#endif
@@ -2364,14 +2359,36 @@ static void BTTFNSendPacket()
23642359
#ifdef DG_DBG
23652360
Serial.printf("Sending multicast (hostname hash %x)\n", tcdHostNameHash);
23662361
#endif
2367-
dgUDP->beginPacket("224.0.0.224", BTTF_DEFAULT_LOCAL_PORT + 1);
2362+
dgUDP->beginPacket(bttfnMcIP, BTTF_DEFAULT_LOCAL_PORT + 1);
23682363
}
23692364
#endif
23702365
dgUDP->write(BTTFUDPBuf, BTTF_PACKET_SIZE);
23712366
dgUDP->endPacket();
23722367
}
23732368

2374-
static bool BTTFNTriggerTT()
2369+
2370+
static void BTTFNSendPacket()
2371+
{
2372+
BTTFNPreparePacket();
2373+
2374+
// Serial
2375+
BTTFUDPID = (uint32_t)millis();
2376+
SET32(BTTFUDPBuf, 6, BTTFUDPID);
2377+
2378+
// Request status and speed
2379+
BTTFUDPBuf[5] = bttfnReqStatus;
2380+
2381+
#ifdef BTTFN_MC
2382+
if(!haveTCDIP) {
2383+
BTTFUDPBuf[5] |= 0x80;
2384+
SET32(BTTFUDPBuf, 31, tcdHostNameHash);
2385+
}
2386+
#endif
2387+
2388+
BTTFNDispatch();
2389+
}
2390+
2391+
static bool bttfn_trigger_tt()
23752392
{
23762393
if(!useBTTFN)
23772394
return false;
@@ -2390,33 +2407,11 @@ static bool BTTFNTriggerTT()
23902407
if(TTrunning)
23912408
return false;
23922409

2393-
memset(BTTFUDPBuf, 0, BTTF_PACKET_SIZE);
2394-
2395-
// ID
2396-
memcpy(BTTFUDPBuf, BTTFUDPHD, 4);
2397-
2398-
// Tell the TCD about our hostname (0-term., 13 bytes total)
2399-
strncpy((char *)BTTFUDPBuf + 10, settings.hostName, 12);
2400-
BTTFUDPBuf[10+12] = 0;
2401-
2402-
BTTFUDPBuf[10+13] = BTTFN_TYPE_PCG;
2403-
2404-
#ifdef BTTFN_MC
2405-
BTTFUDPBuf[4] = BTTFN_VERSION | bttfnMcMarker; // Version, MC-marker
2406-
#else
2407-
BTTFUDPBuf[4] = BTTFN_VERSION;
2408-
#endif
2410+
BTTFNPreparePacket();
2411+
24092412
BTTFUDPBuf[5] = 0x80; // Trigger BTTFN-wide TT
24102413

2411-
uint8_t a = 0;
2412-
for(int i = 4; i < BTTF_PACKET_SIZE - 1; i++) {
2413-
a += BTTFUDPBuf[i] ^ 0x55;
2414-
}
2415-
BTTFUDPBuf[BTTF_PACKET_SIZE - 1] = a;
2416-
2417-
dgUDP->beginPacket(bttfnTcdIP, BTTF_DEFAULT_LOCAL_PORT);
2418-
dgUDP->write(BTTFUDPBuf, BTTF_PACKET_SIZE);
2419-
dgUDP->endPacket();
2414+
BTTFNDispatch();
24202415

24212416
#ifdef DG_DBG
24222417
Serial.println("Triggered BTTFN-wide TT");

src/dg_main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* -------------------------------------------------------------------
33
* Dash Gauges Panel
4-
* (C) 2023-2024 Thomas Winischhofer (A10001986)
4+
* (C) 2023-2025 Thomas Winischhofer (A10001986)
55
* https://github.com/realA10001986/Dash-Gauges
66
* https://dg.out-a-ti.me
77
*

src/dg_settings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* -------------------------------------------------------------------
33
* Dash Gauges Panel
4-
* (C) 2023-2024 Thomas Winischhofer (A10001986)
4+
* (C) 2023-2025 Thomas Winischhofer (A10001986)
55
* https://github.com/realA10001986/Dash-Gauges
66
* https://dg.out-a-ti.me
77
*

src/dg_settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* -------------------------------------------------------------------
33
* Dash Gauges Panel
4-
* (C) 2023-2024 Thomas Winischhofer (A10001986)
4+
* (C) 2023-2025 Thomas Winischhofer (A10001986)
55
* https://github.com/realA10001986/Dash-Gauges
66
* https://dg.out-a-ti.me
77
*

0 commit comments

Comments
 (0)