Skip to content

Commit d7f7e2d

Browse files
committed
v3.5
- Add emergency firmware update via SD (for dev purposes) - WM fixes (Upload, etc) - WM: Skip setting static IP params in Save - Add "No SD present" banner in Config Portal if no SD present - CP: Show msg instead of upload file input if no sd card is present - Let DNS server in AP mode only resolve our domain (hostname) - Allow 6 clients in AP mode instead of 4. So all props can connect to the TCD in AP mode, plus one admin computer/hand held. HOWEVER: Under normal use, do NOT connect a computer or phone to the TCD in AP mode unless for configuration changes. That computer might think it is connected to the internet, resulting in lots of network traffic, leading to packet loss, slowdowns or out-of-sync animations. - More WiFiManager changes. We no longer use NVS-stored WiFi configs, all is managed by our own settings. (No details are known, but it appears as if the core saves some data to NVS on every reboot, this is totally not needed for our purposes, nor in the interest of flash longevity.) - Save static IP only if changed - WiFi Manager overhaul; many changes to Config Portal. WiFi-related settings moved to WiFi Configuration page. Note: If the TCD is in AP-mode, mp3 playback will be stopped when accessing Config Portal web pages from now on. This had lead to sound stutter and incomplete page loads in the past. - Various code optimizations to minimize code size and used RAM - Config Portal: Re-order settings; remove non-checkbox-code. - Turn former compile-time option "SP_ALWAYS_ON" into run-time option "Switch off speedo when idle". SP_ALWAYS_ON still exists but now only defines the default setting. - Turn former BTTF3_ANIM (for part-3-like date entry animation), REV_AM_PM (for reversing AM/PM) and SKIP_TT (for skipping the time-tunnel display animation) options into run-time options. All default to off. - Config Portal: Display image links to currently connected BTTFN clients in top menu - Config Portal: Add "install sound pack" banner to main menu
1 parent 8be9d23 commit d7f7e2d

23 files changed

+4591
-5839
lines changed

Software/platformio.ini

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,14 @@ build_flags =
2424
;see tc_global.h for full explanations of these options
2525
#-DTC_DBG ;enables serial debug
2626
-DCORE_DEBUG_LEVEL=0
27-
#-DUSE_SPIFFS ;use SPIFFS for arduinoespressif32 < 2.0, otherwise use LittleFS - If LittleFS uncomment board_build.filesystem below
2827
#-DIS_ACAR_DISPLAY ;changes the month output to 2 numbers, per the original A Car display
2928
#-DGTE_KEYPAD ;keypad mapping for real GTE/TRW keypad control board
3029
-DTC_HAVESPEEDO ;enables speedo control via i2c - HT16K33-based
3130
#-DSP_CS_0ON ;enable the fake-0 on CircuitSetup's speedo
32-
-DSP_ALWAYS_ON ;keep speedo showing "00" when neither temp nor GPS speed are to be displayed instead of switching it off
3331
-DTC_HAVEGPS ;enables support for a speedo with GPS
3432
-DTC_HAVELIGHT ;enables support for a light sensor via i2c - TLS2561, BH1750
3533
-DTC_HAVETEMP ;support of a temperature/humidity sensor (MCP9808, BMx280, SI7021, SHT40, TMP117, AHT20, HTU31D) connected via i2c
36-
#-DBTTF3_ANIM ;uncomment for alternate "animation" when entering a destination time
37-
#-DREV_AMPM ;uncomment if AM and PM should be reversed (like in BTTF2/3-version of TCD)
3834
-DHAVE_STALE_PRESENT ;99mmddyyyyhhMM sets (and enables) a stale present time/exhibition mode
39-
#-DTT_NO_ANIM ;do not animate time travel sequence
4035
#-DTC_HAVE_RE ;uncomment for rotary encoder support, used to manually select a speed to be displayed on a speedo display
4136
-DTC_HAVE_REMOTE ;uncomment for Remote support - "Remote" is a modified Futaba remote control with CS/A10001986 control board
4237
-DTC_HAVELINEOUT ;support for line-out audio (CB 1.4) is included
@@ -56,7 +51,7 @@ board = nodemcu-32s
5651
platform_packages = platformio/framework-arduinoespressif32
5752
board_build.f_cpu = 240000000L
5853
board_build.flash_mode = qio
59-
board_build.filesystem = LittleFS ;uncomment if using LittleFS - make sure USE_SPIFFS IS commented below
54+
board_build.filesystem = LittleFS
6055
upload_speed = 921600
6156
monitor_speed = 115200
6257

Software/src/clockdisplay.cpp

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@
7676
#define CD_AMPM_POS CD_DAY_POS
7777
#define CD_COLON_POS CD_YEAR_POS
7878

79-
#ifndef REV_AMPM
80-
#define _AM 0x0080
81-
#define _PM 0x8000
82-
#else
83-
#define _AM 0x8000
84-
#define _PM 0x0080
85-
#endif
86-
8779
extern bool alarmOnOff;
8880
#ifdef TC_HAVEGPS
8981
extern bool gpsHaveFix();
@@ -106,15 +98,15 @@ static const char months[13][4] = {
10698
" _"
10799
};
108100

109-
#ifdef BTTF3_ANIM
101+
#ifndef IS_ACAR_DISPLAY
110102
static const uint8_t idxtbl[] = {
111-
0,
112-
CD_DAY_POS, CD_DAY_POS,
113-
CD_YEAR_POS, CD_YEAR_POS,
114-
CD_YEAR_POS + 1, CD_YEAR_POS + 1,
115-
CD_HOUR_POS,
116-
CD_HOUR_POS, CD_HOUR_POS,
117-
CD_MIN_POS, CD_MIN_POS
103+
0,
104+
CD_DAY_POS, CD_DAY_POS,
105+
CD_YEAR_POS, CD_YEAR_POS,
106+
CD_YEAR_POS + 1, CD_YEAR_POS + 1,
107+
CD_HOUR_POS,
108+
CD_HOUR_POS, CD_HOUR_POS,
109+
CD_MIN_POS, CD_MIN_POS
118110
};
119111
#endif
120112

@@ -129,9 +121,6 @@ static const char *fnSD[3] = {
129121
static const char *fnLastYear = "/tcdly";
130122
static const char *fnLastYearSD = "/tcdly.bin";
131123

132-
static const uint16_t _am = _AM;
133-
static const uint16_t _pm = _PM;
134-
135124
/*
136125
* ClockDisplay class
137126
*/
@@ -313,7 +302,7 @@ void clockDisplay::showAnimate1()
313302
}
314303

315304
// Show month, assumes showAnimate1() was called before
316-
#ifndef BTTF3_ANIM
305+
#ifdef IS_ACAR_DISPLAY
317306
void clockDisplay::showAnimate2()
318307
{
319308
if(_nightmode && _NmOff)
@@ -327,9 +316,7 @@ void clockDisplay::showAnimate2()
327316
}
328317
Wire.endTransmission();
329318
}
330-
331-
#else
332-
319+
#else // IS_ACAR_DISPLAY
333320
void clockDisplay::showAnimate2(int until)
334321
{
335322
if(_nightmode && _NmOff)
@@ -386,7 +373,7 @@ void clockDisplay::showAnimate3(int mystep)
386373
showAnimate2(lim);
387374
}
388375
}
389-
#endif // BTTF3_ANIM
376+
#endif // IS_ACAR_DISPLAY
390377

391378
void clockDisplay::showAlt()
392379
{

Software/src/clockdisplay.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ struct dateStruct {
7777
#define CDD_FORCE24 0x0001
7878
#define CDD_NOLEAD0 0x0002
7979

80+
#define _AM 0x0080
81+
#define _PM 0x8000
82+
8083
class clockDisplay {
8184

8285
public:
@@ -103,6 +106,8 @@ class clockDisplay {
103106
void set1224(bool hours24) { _mode24 = hours24; }
104107
bool get1224() { return _mode24; }
105108

109+
void setAMPMOrder(bool reverse) { _am = reverse ? _PM : _AM; _pm = reverse ? _AM : _PM; }
110+
106111
void setNightMode(bool mymode) { _nightmode = mymode; }
107112
bool getNightMode() { return _nightmode; }
108113
void setNMOff(bool NMOff) { _NmOff = NMOff; }
@@ -112,11 +117,11 @@ class clockDisplay {
112117

113118
void show();
114119
void showAnimate1();
115-
#ifdef BTTF3_ANIM
120+
#ifdef IS_ACAR_DISPLAY
121+
void showAnimate2();
122+
#else
116123
void showAnimate2(int until = CD_BUF_SIZE);
117124
void showAnimate3(int mystep);
118-
#else
119-
void showAnimate2();
120125
#endif
121126

122127
void showAlt();
@@ -214,6 +219,10 @@ class clockDisplay {
214219
int16_t _lastWrittenYO = -11111;
215220
bool _lastWrittenRead = false;
216221

222+
bool _mode24 = false; // true = 24 hour mode, false = 12 hour mode
223+
uint16_t _am = _AM;
224+
uint16_t _pm = _PM;
225+
217226
uint8_t _month = 1;
218227
uint8_t _day = 1;
219228
uint8_t _hour = 0;
@@ -222,7 +231,6 @@ class clockDisplay {
222231
bool _rtc = false; // will this be displaying real time
223232
uint8_t _brightness = 15; // current display brightness
224233
uint8_t _origBrightness = 15; // value from settings
225-
bool _mode24 = false; // true = 24 hour mode, false = 12 hour mode
226234
bool _nightmode = false; // true = dest/dept times off
227235
bool _NmOff = false; // true = off during night mode, false = dimmed
228236
int _oldnm = -1;

Software/src/gps.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ bool tcGPS::begin(unsigned long powerupTime, int quickUpdates, int speedRate, vo
186186

187187
_customDelayFunc = defaultDelay;
188188

189-
_currentline = _line1;
190-
_lenIdx = 0;
191-
192189
fix = false;
193190
_speed = -1;
194191
_haveSpeed = false;
@@ -221,6 +218,14 @@ bool tcGPS::begin(unsigned long powerupTime, int quickUpdates, int speedRate, vo
221218
} else
222219
return false;
223220

221+
_buffer = (char *)malloc(GPS_MAX_I2C_LEN + GPS_MAXLINELEN);
222+
if(!_buffer) return false;
223+
224+
_line1 = _buffer + GPS_MAX_I2C_LEN;
225+
226+
_currentline = _line1;
227+
_lenIdx = 0;
228+
224229
// Send xxRMC and xxZDA only, for high rates also xxVTG
225230
// If we use GPS for speed, we need more frequent updates.
226231
// The value in PKT 314 is a multiplier for the value of PKT 220.

Software/src/gps.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ class tcGPS {
9191
int _lenIdx = 0;
9292
int _lenLimit = GPS_LENBUFLIMIT;
9393

94-
char _buffer[GPS_MAX_I2C_LEN];
94+
char *_buffer = NULL;
9595
char _last_char = 0;
9696

97-
char _line1[GPS_MAXLINELEN];
97+
char *_line1 = NULL;
9898
char *_currentline;
9999
uint8_t _lineidx = 0;
100100
unsigned long _currentTS = 0;

0 commit comments

Comments
 (0)