Skip to content

Commit

Permalink
V3.2.001
Browse files Browse the repository at this point in the history
  • Loading branch information
realA10001986 authored Jan 1, 2025
1 parent 1902173 commit d8bdeb2
Show file tree
Hide file tree
Showing 28 changed files with 118 additions and 94 deletions.
2 changes: 1 addition & 1 deletion timecircuits-A10001986/clockdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/clockdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/gps.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/gps.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
5 changes: 2 additions & 3 deletions timecircuits-A10001986/input.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand All @@ -16,7 +16,6 @@
* - DFRobot Gravity 360: SW1 off, SW2 on (i2c address 0x55)
* - DuPPA I2CEncoder 2.1: A0 and A1 closed (i2c address 0x03)
*
*
* Keypad part inspired by "Keypad" library by M. Stanley & A. Brevig
* Fractions of this code are customized, minimized derivates of parts
* of the OneButton library by Matthias Hertel.
Expand Down Expand Up @@ -346,7 +345,7 @@ void Keypad_I2C::port_write(uint8_t val)
* activeLow: Set to true when the input level is LOW when the button is pressed, Default is true.
* pullupActive: Activate the internal pullup when available. Default is true.
*/
TCButton::TCButton(const int pin, const boolean activeLow, const bool pullupActive)
TCButton::TCButton(const int pin, const bool activeLow, const bool pullupActive)
{
_pin = pin;

Expand Down
15 changes: 10 additions & 5 deletions timecircuits-A10001986/input.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
/*
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
* Keypad_I2C Class, TCButton Class: I2C-Keypad and Button handling
*
* TCRotEnc: Rotary Encoder handling:
* Supports Adafruit 4991, DuPPA I2CEncoder 2.1, DFRobot Gravity 360
* DuPPA I2CEncoder 2.1 must be set to i2c address 0x01 (A0 closed).
* Supports Adafruit 4991, DuPPA I2CEncoder 2.1, DFRobot Gravity 360.
* For Speed, the encoders must be set to their default i2c address
* (DuPPA I2CEncoder 2.1 must be set to i2c address 0x01 (A0 closed)).
* For Volume, the encoders must be configured as follows:
* - Ada4991: A0 closed (i2c address 0x37)
* - DFRobot Gravity 360: SW1 off, SW2 on (i2c address 0x55)
* - DuPPA I2CEncoder 2.1: A0 and A1 closed (i2c address 0x03)
*
* Keypad part inspired by "Keypad" library by M. Stanley & A. Brevig
* Fractions of this code are customized, minimized derivates of parts
* of OneButton library by Matthias Hertel.
* of the OneButton library by Matthias Hertel.
* -------------------------------------------------------------------
* License of Keypad_I2C class: MIT NON-AI
*
Expand Down Expand Up @@ -183,7 +188,7 @@ typedef enum {
class TCButton {

public:
TCButton(const int pin, const boolean activeLow = true, const bool pullupActive = true);
TCButton(const int pin, const bool activeLow = true, const bool pullupActive = true);

void setTiming(const int debounceDur, const int pressDur, const int lPressDur);

Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/rtc.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/rtc.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/sensors.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/sensors.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
47 changes: 29 additions & 18 deletions timecircuits-A10001986/speeddisplay.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down Expand Up @@ -67,6 +67,10 @@
#include "speeddisplay.h"
#include <Wire.h>

// Speedo displays "--" for NO_FIX_DASHES ms if GPS fix is
// lost, afterwards it will display "00.".
#define NO_FIX_DASHES 1000*60

// The segments' wiring to buffer bits
// This reflects the actual hardware wiring

Expand Down Expand Up @@ -578,32 +582,39 @@ void speedDisplay::setText(const char *text)
// (including current dot01 setting; colon is cleared and ignored)
void speedDisplay::setSpeed(int8_t speedNum)
{
uint16_t b1, b2;
unsigned long b1 = 0, b2 = 0;
uint8_t b3 = 0b00111111;
unsigned long now = millis();

clearBuf();

_speed = speedNum;

#ifndef GPS_DISPLAY_DASHES
if(speedNum < 0) speedNum = 0;
#else
if(speedNum < 0) {
b1 = b2 = *(_fontXSeg + 37);
} else
#endif
if(speedNum > 99) {
b1 = *(_fontXSeg + ('H' - 'A' + 10));
b2 = *(_fontXSeg + ('I' - 'A' + 10));
if((_lastPosSpd > 3) && (now - _posSpdNow < NO_FIX_DASHES)) {
b1 = b2 = 37;
b3 = 0;
}
} else {
b1 = *(_fontXSeg + (speedNum / 10));
b2 = *(_fontXSeg + (speedNum % 10));
#ifdef SP_CS_0ON
if(_dispType == SP_CIRCSETUP) {
// Hack to display "0" after dot
_displayBuffer[2] = 0b00111111;
_posSpdNow = now;
_lastPosSpd = speedNum;
if(speedNum > 99) {
b1 = 'H' - 'A' + 10;
b2 = 'I' - 'A' + 10;
b3 = 0;
} else {
b1 = speedNum / 10;
b2 = speedNum % 10;
}
#endif
}
b1 = *(_fontXSeg + b1);
b2 = *(_fontXSeg + b2);
#ifdef SP_CS_0ON
if(_dispType == SP_CIRCSETUP) {
// Hack to display "0" after dot
_displayBuffer[2] = b3;
}
#endif

_displayBuffer[_speed_pos10] |= (b1 << _dig10_shift);
_displayBuffer[_speed_pos01] |= (b2 << _dig01_shift);
Expand Down
5 changes: 4 additions & 1 deletion timecircuits-A10001986/speeddisplay.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down Expand Up @@ -155,6 +155,9 @@ class speedDisplay {

int8_t _speed = 0;

unsigned long _posSpdNow = 0;
int8_t _lastPosSpd = 5;

uint8_t _brightness = 15;
uint8_t _origBrightness = 15;
bool _nightmode = false;
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/tc_audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/tc_audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/tc_beep.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/tc_font.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
31 changes: 14 additions & 17 deletions timecircuits-A10001986/tc_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand All @@ -25,11 +25,11 @@

// These must not contain any characters other than
// '0'-'9', 'A'-'Z', '(', ')', '.', '_', '-' or space
#define TC_VERSION "V3.2.000" // 13 chars max
#define TC_VERSION "V3.2.001" // 13 chars max
#ifndef IS_ACAR_DISPLAY
#define TC_VERSION_EXTRA "NOV072024" // 13 chars max
#define TC_VERSION_EXTRA "JAN012025" // 13 chars max
#else // A-Car
#define TC_VERSION_EXTRA "11072024" // 12 chars max
#define TC_VERSION_EXTRA "01012025" // 12 chars max
#endif

//#define TC_DBG // debug output on Serial
Expand Down Expand Up @@ -63,15 +63,12 @@
#define SP_MIN_TYPE 0
#ifdef TC_HAVESPEEDO
// Uncomment to keep speedo showing "00." when neither temp, nor GPS speed,
// nor fake speed through rotary encoder are to be displayed instead of
// nor fake speed through rotary encoder are to be displayed, instead of
// switching it off when idle.
//#define SP_ALWAYS_ON
// Uncomment to enable the fake-0 on CircuitSetup's speedo; is not usable
// as a full third digit, just displays "0" when speed to be displayed
//#define SP_CS_0ON
// Uncomment to have the Speedo display "--" when there is no GPS fix.
// When commented, it will display 0.
//#define GPS_DISPLAY_DASHES
#endif

// Uncomment for rotary encoder support
Expand All @@ -87,15 +84,15 @@

// Uncomment for Remote control support
// "Remote" is a modified Futaba remote control with CS/A10001986 control board
// and the A10001986 "remote" firmware.
// and the A10001986 "remote" firmware. See https://remote.out-a-ti.me
#define TC_HAVE_REMOTE

// Uncomment for support of a temperature/humidity sensor (MCP9808, BMx280,
// SI7021, SHT4x, TMP117, AHT20, HTU31D, MS8607) connected via i2c. Will be used
// for room condition mode and to display ambient temperature on speedometer
// display when idle (GPS speed has higher priority, ie if "Display GPS speed"
// is checked in the Config Portal, temperature will not be shown on speedo).
// See sensors.cpp for supported i2c slave addresses
// SI7021, SHT4x, TMP117, AHT20, HTU31D, MS8607, HDC302x) connected via i2c.
// Will be used for room condition mode and to display ambient temperature on
// speedometer display when idle (GPS speed has higher priority, ie if "Display
// GPS speed" is checked in the Config Portal, temperature will not be shown on
// speedo). See sensors.cpp for supported i2c slave addresses
#define TC_HAVETEMP

// Uncomment for support of a light sensor (TSL2561/2591, BH1750, VEML7700/6030
Expand Down Expand Up @@ -300,12 +297,12 @@

// NTP baseline data: Prolong life time of NTP and GPS
// Set this to current year. Stop at 2036.
#define TCEPOCH 2024
#define TCEPOCH 2025
// Set to SECS1970_xxxx, xxxx being current year. Stop at 2036.
#define TCEPOCH_SECS SECS1970_2024
#define TCEPOCH_SECS SECS1970_2025

// Epoch for general use; increase yearly, no limit
// Defines the minimum date considered valid
#define TCEPOCH_GEN 2024
#define TCEPOCH_GEN 2025

#endif
2 changes: 1 addition & 1 deletion timecircuits-A10001986/tc_keypad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/tc_keypad.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
3 changes: 2 additions & 1 deletion timecircuits-A10001986/tc_menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down Expand Up @@ -84,6 +84,7 @@
* - show network information ("NET-WORK"),
* - enter dates/times for the three displays/set built-in RTC,
* - show currently measured data from connected sensors ("SENSORS"),
* - show currently registered BTTF clients ("BTTF CLIENTS"),
* - quit the menu ("END").
*
* Pressing ENTER cycles through the list, holding ENTER selects an item.
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/tc_menus.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
2 changes: 1 addition & 1 deletion timecircuits-A10001986/tc_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* -------------------------------------------------------------------
* CircuitSetup.us Time Circuits Display
* (C) 2021-2022 John deGlavina https://circuitsetup.us
* (C) 2022-2024 Thomas Winischhofer (A10001986)
* (C) 2022-2025 Thomas Winischhofer (A10001986)
* https://github.com/realA10001986/Time-Circuits-Display
* https://tcd.out-a-ti.me
*
Expand Down
Loading

0 comments on commit d8bdeb2

Please sign in to comment.