1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 09:53:45 +02:00

DCC time broadcast and DS1307 clock chip

This commit is contained in:
Asbelos
2025-01-12 11:47:43 +00:00
parent 32066a3bfa
commit f031add7a0
7 changed files with 277 additions and 1 deletions

View File

@@ -185,6 +185,9 @@ void CommandDistributor::setClockTime(int16_t clocktime, int8_t clockrate, byte
{
case 1:
if (clocktime != lastclocktime){
auto difference = clocktime - lastclocktime;
if (difference<0) difference+=1440;
DCC::setTime(clocktime,clockrate,difference>2);
// CAH. DIAG removed because LCD does it anyway.
LCD(6,F("Clk Time:%d Sp %d"), clocktime, clockrate);
// look for an event for this time