Skip to content

Commit 891752f

Browse files
committed
Refactor GPS, input, and sensor handling; update assets
- New sound pack (TW05/CS05) - Keypad menu: Add navigation using keypad keys 2 (up), 5 (select), 8 (down), 9 (cancel). Old "ENTER" method still supported. - Add MQTT commands "PLAY_DOOR_OPEN", "PLAY_DOOR_CLOSE" (with optional appendices "_L"/"_R" for playing it on one stereo channel only). - Add way for Dash Gauges to play door open/close sounds through TCD (Gauges >= 1.29) - Fix float settings (temp offset, accel figure factor; broken since 3.6) - Add new notification, which eliminates the need for clients to poll for data and helps to reduce network traffic.(For full effect, other props need updates, too: FC >= 1.91, SID >= 1.63, Gauges >= 1.30, VSR >= 1.25, Remote >= 1.16) - Eliminate DNS lookups in loop() (which were a possible reason for sound-stutter sometimes) - NTP/GPS time sync logic enhancements - Various code optimizations (audio, GPS, network, etc)
1 parent be10a2f commit 891752f

46 files changed

Lines changed: 3607 additions & 2086 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
49.8 KB
Binary file not shown.
1.13 MB
Binary file not shown.
1.12 MB
Binary file not shown.
-1.12 MB
Binary file not shown.

Software/src/clockdisplay.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* -------------------------------------------------------------------
33
* CircuitSetup.us Time Circuits Display
44
* (C) 2021-2022 John deGlavina https://circuitsetup.us
5-
* (C) 2022-2025 Thomas Winischhofer (A10001986)
5+
* (C) 2022-2026 Thomas Winischhofer (A10001986)
66
* https://github.com/realA10001986/Time-Circuits-Display
77
* https://tcd.out-a-ti.me
88
*
@@ -145,7 +145,7 @@ void clockDisplay::begin()
145145

146146
// Turn on the display
147147
void clockDisplay::on()
148-
{
148+
{
149149
directCmd(0x80 | 1);
150150
}
151151

@@ -378,6 +378,7 @@ void clockDisplay::showAnimate3(int mystep)
378378
if(!_mode24) {
379379
(_hour < 12) ? AM() : PM();
380380
}
381+
// fall through
381382
default:
382383
showAnimate2(lim);
383384
}
@@ -484,9 +485,7 @@ void clockDisplay::setYear(uint16_t yearNum)
484485
}
485486

486487
void clockDisplay::setHour(uint16_t hourNum)
487-
{
488-
uint16_t seg = 0;
489-
488+
{
490489
if(hourNum > 23)
491490
hourNum = 23;
492491

@@ -692,7 +691,9 @@ void clockDisplay::showHalfIPDirect(int a, int b, uint16_t flags)
692691
#endif
693692

694693
if(a > 255) a = 255; // Avoid buf overflow if numbers too high
694+
else if(a < 0) a = 0;
695695
if(b > 255) b = 255;
696+
else if(b < 0) b = 0;
696697

697698
#ifdef IS_ACAR_DISPLAY
698699
sprintf(buf, (a >= 100) ? fmt1 : fmt2, a, b);
@@ -732,7 +733,7 @@ void clockDisplay::showTempDirect(float temp, bool tempUnit, bool animate)
732733
sprintf(buf, "%s ----~%c", ttem, tempUnit ? 'C' : 'F');
733734
#endif
734735
} else {
735-
t2 = abs((int)(temp * 100.0) - ((int)temp * 100));
736+
t2 = abs((int)(temp * 100.0f) - ((int)temp * 100));
736737
#ifdef IS_ACAR_DISPLAY
737738
sprintf(buf, "%s%4d%02d~%c", ttem, (int)temp, t2, tempUnit ? 'C' : 'F');
738739
#else
@@ -744,9 +745,7 @@ void clockDisplay::showTempDirect(float temp, bool tempUnit, bool animate)
744745
showTextDirect(buf);
745746
_yearDot = false;
746747

747-
if(animate || (_NmOff && (_oldnm > 0)) ) on();
748-
749-
if(_NmOff) _oldnm = 0;
748+
showIntTail(animate);
750749
}
751750

752751
void clockDisplay::showHumDirect(int hum, bool animate)
@@ -773,9 +772,7 @@ void clockDisplay::showHumDirect(int hum, bool animate)
773772

774773
showTextDirect(buf);
775774

776-
if(animate || (_NmOff && (_oldnm > 0)) ) on();
777-
778-
if(_NmOff) _oldnm = 0;
775+
showIntTail(animate);
779776
}
780777
#endif
781778

@@ -1220,7 +1217,13 @@ void clockDisplay::showInt(bool animate, bool Alt)
12201217
}
12211218

12221219
Wire.endTransmission();
1220+
1221+
showIntTail(animate);
1222+
}
12231223

1224+
void clockDisplay::showIntTail(bool animate)
1225+
{
1226+
if(animate) directCmd(0x20 | 1);
12241227
if(animate || (_NmOff && (_oldnm > 0)) ) on();
12251228

12261229
if(_NmOff) _oldnm = 0;

Software/src/clockdisplay.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* -------------------------------------------------------------------
33
* CircuitSetup.us Time Circuits Display
44
* (C) 2021-2022 John deGlavina https://circuitsetup.us
5-
* (C) 2022-2025 Thomas Winischhofer (A10001986)
5+
* (C) 2022-2026 Thomas Winischhofer (A10001986)
66
* https://github.com/realA10001986/Time-Circuits-Display
77
* https://tcd.out-a-ti.me
88
*
@@ -198,6 +198,7 @@ class clockDisplay {
198198
void clearDisplay();
199199
bool handleNM();
200200
void showInt(bool animate = false, bool Alt = false);
201+
void showIntTail(bool animate);
201202

202203
void colonOn();
203204
void colonOff();

0 commit comments

Comments
 (0)