From b9401604ea32b228e8d5d950cf1f63531990a8df Mon Sep 17 00:00:00 2001 From: 135 Date: Thu, 11 Jul 2024 00:18:17 +0300 Subject: [PATCH] WIP --- GPS-RTC-Clock.ino | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/GPS-RTC-Clock.ino b/GPS-RTC-Clock.ino index ceb8541..8fb6582 100644 --- a/GPS-RTC-Clock.ino +++ b/GPS-RTC-Clock.ino @@ -656,7 +656,6 @@ void setRTC_Date(int yyyy, byte mo, byte dd) { void RunStateMachine() { byte temp_buffer; - //135Serial.println("R-SM"); switch (StateMachine) { @@ -674,8 +673,7 @@ void RunStateMachine() { Serial.println("No PPS detected."); } break; //end DEBUG case - - + // ------------------------------ case BOOTUP: @@ -701,15 +699,13 @@ void RunStateMachine() { // ------------------------------ case REG_OPS: - //135Serial.println("REG_OPS"); - displayRTC(); //keep the trains running //if (mmRTC == 40 && ssRTC == 0) { //every hour at minute 15, do a GPS_INIT check to prep for GPS-to-RTC time update if (mmRTC != 0 && ssRTC == 0) { GPS_INIT_t0 = millis(); //sets our timer to allow a timeout in the next state getRTC(); - serialRTC_timeOnMax(ddRTC,moRTC,yyRTC); + serialRTC_timeOnMax(hhRTC,mmRTC,ssRTC); Serial.println(">GPS_INIT"); StateMachine = GPS_INIT; // >>>> State Change! <<<GPS_PPS_SYNC"); StateMachine = GPS_PPS_SYNC; // >>>> State Change! <<< 4000) { //timeout this state after 4 secs if no PPS detected getRTC(); - serialRTC_timeOnMax(ddRTC,moRTC,yyRTC); + serialRTC_timeOnMax(hhRTC,mmRTC,ssRTC); Serial.println(">GPS_NMEA_SYNC"); StateMachine = GPS_NMEA_SYNC; // >>>> State Change! <<<REG_OPS"); StateMachine = REG_OPS; // >>>> State Change! <<< 14000) { //timeout this state after 10 secs if no PPS detected getRTC(); - serialRTC_timeOnMax(ddRTC,moRTC,yyRTC); + serialRTC_timeOnMax(hhRTC,mmRTC,ssRTC); Serial.println(">REG_OPS"); StateMachine = REG_OPS; // >>>> State Change! <<< 14000) { //timeout this state after 10 secs if no PPS detected getRTC(); - serialRTC_timeOnMax(ddRTC,moRTC,yyRTC); + serialRTC_timeOnMax(hhRTC,mmRTC,ssRTC); Serial.println(">REG_OPS"); StateMachine = REG_OPS; // >>>> State Change! <<<