Skip to content

Commit

Permalink
Small fixes to v2.9
Browse files Browse the repository at this point in the history
- Don't use speedo if not detected
- Auto-expire beep-timer when entering night mode
- Whenever the beep timer is(would be) restarted, the wakeup is sent
- Colons on in night mode
- Fix P1 length sent to BTTFN clients
  • Loading branch information
CircuitSetup committed Oct 23, 2023
1 parent dbbe06c commit b4d5ef4
Show file tree
Hide file tree
Showing 29 changed files with 106 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Software/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ build_flags =
#-DREV_AMPM ;uncomment if AM and PM should be reversed (like in BTTF2/3-version of TCD)
-DHAVE_STALE_PRESENT ;99mmddyyyyhhMM sets (and enables) a stale present time/exhibition mode
#-DTT_NO_ANIM ;do not animate time travel sequence
#-DNOT_MY_RESPONSIBILITY
#-DNOT_MY_RESPONSIBILITY ;enables automatic time travel when the speedo reaches 88mph - use at your own risk
board_build.filesystem = LittleFS ;uncomment if using LittleFS - make sure USE_SPIFFS IS commented above
build_src_flags =
-DDEBUG_PORT=Serial
Expand Down
6 changes: 3 additions & 3 deletions Software/src/clockdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Clockdisplay Class: Handles the TC LED segment displays
*
Expand Down Expand Up @@ -584,9 +584,9 @@ void clockDisplay::setMinute(int minNum)
void clockDisplay::setColon(bool col)
{
// set true to turn it on
// colon is off in night mode
// colon is on in night mode

_colon = _nightmode ? false : col;
_colon = _nightmode ? true : col;
}

void clockDisplay::setDST(int8_t isDST)
Expand Down
2 changes: 1 addition & 1 deletion Software/src/clockdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Clockdisplay Class: Handles the TC LED segment displays
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CircuitSetup.us Time Circuits Display
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* GPS Class: GPS receiver handling and data parsing
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/gps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CircuitSetup.us Time Circuits Display
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* GPS Class: GPS receiver handling and data parsing
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CircuitSetup.us Time Circuits Display
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Keypad_I2C Class, TCButton Class: I2C-Keypad and Button handling
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CircuitSetup.us Time Circuits Display
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Keypad_I2C Class, TCButton Class: I2C-Keypad and Button handling
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/rtc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CircuitSetup.us Time Circuits Display
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* RTC Class (DS3231/PCF2129 RTC handling) and DateTime Class
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CircuitSetup.us Time Circuits Display
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* RTC Class (DS3231/PCF2129 RTC handling) and DateTime Class
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CircuitSetup.us Time Circuits Display
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Sensor Class: Temperature/humidty and Light Sensor handling
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CircuitSetup.us Time Circuits Display
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Sensor Class: Temperature/humidity and Light Sensor handling
*
Expand Down
11 changes: 9 additions & 2 deletions Software/src/speeddisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CircuitSetup.us Time Circuits Display
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* speedDisplay Class: Speedo Display
*
Expand Down Expand Up @@ -325,7 +325,7 @@ speedDisplay::speedDisplay(uint8_t address)
}

// Start the display
void speedDisplay::begin(int dispType)
bool speedDisplay::begin(int dispType)
{
if(dispType < SP_MIN_TYPE || dispType >= SP_NUM_TYPES) {
#ifdef TC_DBG
Expand All @@ -334,6 +334,11 @@ void speedDisplay::begin(int dispType)
dispType = SP_MIN_TYPE;
}

// Check for speedo on i2c bus
Wire.beginTransmission(_address);
if(Wire.endTransmission(true))
return false;

_dispType = dispType;
_is7seg = displays[dispType].is7seg;
_speed_pos10 = displays[dispType].speed_pos10;
Expand All @@ -357,6 +362,8 @@ void speedDisplay::begin(int dispType)
setBrightness(15); // setup initial brightness
clearDisplay(); // clear display RAM
on(); // turn it on

return true;
}

// Turn on the display
Expand Down
4 changes: 2 additions & 2 deletions Software/src/speeddisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CircuitSetup.us Time Circuits Display
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* speedDisplay Class: Speedo Display
*
Expand Down Expand Up @@ -80,7 +80,7 @@ class speedDisplay {
public:

speedDisplay(uint8_t address);
void begin(int dispType);
bool begin(int dispType);
void on();
void off();
#if 0
Expand Down
2 changes: 1 addition & 1 deletion Software/src/tc_audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Sound handling
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/tc_audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Sound handling
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/tc_beep.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Beep sound
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/tc_font.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Font for TC LED segment displays
*
Expand Down
12 changes: 6 additions & 6 deletions Software/src/tc_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Global definitions
*/
Expand All @@ -27,9 +27,9 @@
// '0'-'9', 'A'-'Z', '(', ')', '.', '_', '-' or space
#define TC_VERSION "V2.9" // 13 chars max
#ifndef IS_ACAR_DISPLAY
#define TC_VERSION_EXTRA "OCT022023" // 13 chars max
#define TC_VERSION_EXTRA "OCT102023" // 13 chars max
#else // A-Car
#define TC_VERSION_EXTRA "10022023" // 12 chars max
#define TC_VERSION_EXTRA "10102023" // 12 chars max
#endif

//#define TC_DBG // debug output on Serial
Expand Down Expand Up @@ -113,9 +113,9 @@
// Uncomment for bttf network support
#define TC_HAVEBTTFN

// Uncomment to include stale present time mode
// 99mmddyyyyhhMM sets (and enables) a stale present time;
// 999 toggles between stale time and normal operation
// Uncomment to include Exhibition mode
// 99mmddyyyyhhMM sets (and enables) EM with fixed present time as given;
// 999 toggles between EM and normal operation
//#define HAVE_STALE_PRESENT

// --- end of config options
Expand Down
11 changes: 10 additions & 1 deletion Software/src/tc_keypad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Keypad handling
*
Expand Down Expand Up @@ -476,6 +476,7 @@ void keypad_loop()
ettNow = millis();
ettDelayed = true;
startBeepTimer();
send_wakeup_msg();
}
isEttKeyPressed = isEttKeyHeld = isEttKeyImmediate = false;
}
Expand Down Expand Up @@ -1213,6 +1214,9 @@ void keypad_loop()

// Beep auto mode: Restart timer
startBeepTimer();

// Send "wakeup" to network clients
send_wakeup_msg();
}

if(validEntry) {
Expand Down Expand Up @@ -1557,6 +1561,11 @@ void nightModeOn()
{
setNightMode(true);
leds_off();
// Expire beep timer
if(beepMode >= 2) {
beepTimer = false;
muteBeep = true;
}
}

void nightModeOff()
Expand Down
2 changes: 1 addition & 1 deletion Software/src/tc_keypad.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Keypad handling
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/tc_menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Keypad Menu handling
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/tc_menus.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Keypad Menu handling
*
Expand Down
2 changes: 1 addition & 1 deletion Software/src/tc_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Settings & file handling
*
Expand Down
6 changes: 3 additions & 3 deletions Software/src/tc_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2023 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* http://tcd.backtothefutu.re
* https://tcd.backtothefutu.re
*
* Settings handling
*
Expand Down Expand Up @@ -85,10 +85,10 @@ extern uint8_t musFolderNum;
#define DEF_LUX_LIMIT 3 // Default Lux for night mode
#define DEF_USE_ETTO 0 // Default: 0: No external props
#define DEF_NO_ETTO_LEAD 0 // Default: 0: ETTO with ETTO_LEAD lead time; 1 without
#define DEF_QUICK_GPS 0 // Default: Slow GPS updates
#define DEF_QUICK_GPS 0 // Default: Slow GPS updates (unless speed is being displayed)
#define DEF_PLAY_TT_SND 1 // Default 1: Play time travel sounds (0: Do not; for use with external equipment)
#define DEF_SHUFFLE 0 // Music Player: Do not shuffle by default
#define DEF_CFG_ON_SD 1 // Default: Save alarm/volume settings on SD
#define DEF_CFG_ON_SD 1 // Default: Save secondary settings on SD
#define DEF_SD_FREQ 0 // SD/SPI frequency: Default 16MHz

struct Settings {
Expand Down
Loading

0 comments on commit b4d5ef4

Please sign in to comment.