Added clock-halt handling and improved display.
This commit is contained in:
@@ -53,6 +53,7 @@ void Fastclock::loop(void) {
|
||||
msPerModelSecond = 500;
|
||||
}
|
||||
if (newTimeTick - lastTimeTickUsed < MIN_TIME_ms_BETWEEN_CLOCK_UPDATES) return;
|
||||
if (halted) { lastTimeTickUsed = newTimeTick; return; }
|
||||
int fastclockTimeAdvance = (newTimeTick - lastTimeTickUsed) * 1000 / msPerModelSecond;
|
||||
|
||||
oldMinute = minute;
|
||||
@@ -72,4 +73,9 @@ void Fastclock::loop(void) {
|
||||
void Fastclock::begin(void) {
|
||||
lastTimeTickUsed = millis();
|
||||
Serial.print("*** Setting up Fastclock, init lastSentTimeTick="); Serial.println(lastTimeTickUsed);
|
||||
// following setters do not change anything, but they update the display as well
|
||||
setClockSpeed(msPerModelSecond);
|
||||
|
||||
display->setClockHalted(halted);
|
||||
display->setTime(hour, minute);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user