From a0a88fa2c96052e161f489105bda26d8d560160a Mon Sep 17 00:00:00 2001 From: norbert-walter Date: Sat, 7 Feb 2026 17:05:41 +0100 Subject: [PATCH] Modify reagatta timer funktion --- lib/obp60task/OBPSensorTask.cpp | 8 ++++---- lib/obp60task/PageClock.cpp | 18 +++++++++++------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/obp60task/OBPSensorTask.cpp b/lib/obp60task/OBPSensorTask.cpp index d296ac2..25d861b 100644 --- a/lib/obp60task/OBPSensorTask.cpp +++ b/lib/obp60task/OBPSensorTask.cpp @@ -425,7 +425,7 @@ void sensorTask(void *param){ N2K = GPS time on N2K od 183 bus 0 = device not ready 1 = device ready - X = undependend + X = independend () = source for set time N2K -> = set RTC via iRTC <- = set RTC via GPS @@ -442,8 +442,8 @@ void sensorTask(void *param){ */ - // If RTC DS1388 ready, then copy iRTC and GPS data to RTC all 5min - if(millis() > starttime11 + 5*60*1000){ + // If RTC DS1388 ready, then copy iRTC and GPS data to RTC all 1min + if(millis() > starttime11 + 1*60*1000){ starttime11 = millis(); // Set RTC chip via iRTC (NTP) if(iRTC_ready == true && RTC_ready == true && GPS_ready == false){ @@ -497,7 +497,7 @@ void sensorTask(void *param){ // Send RTC date and time to N2K all 500ms if (millis() > starttime12 + 500) { starttime12 = millis(); - // Send date and time from RTC chip + // Send date and time from RTC chip if GPS not ready if (rtcOn == "DS1388" && RTC_ready) { DateTime dt = ds1388.now(); sensors.rtcTime.tm_year = dt.year() - 1900; // Save values in SensorData diff --git a/lib/obp60task/PageClock.cpp b/lib/obp60task/PageClock.cpp index c3bcfa8..a1d505c 100644 --- a/lib/obp60task/PageClock.cpp +++ b/lib/obp60task/PageClock.cpp @@ -205,7 +205,7 @@ public: timerHours = timerStartHours; timerMinutes = timerStartMinutes; timerSeconds = timerStartSeconds; - commonData->keydata[4].label = "RESET"; +// commonData->keydata[4].label = "RESET"; } return 0; } @@ -242,6 +242,7 @@ public: timerMinutes = timerStartMinutes; timerSeconds = timerStartSeconds; timerRunning = false; + showSelectionMarker = true; // marker will become visible again only after POS press } return 0; @@ -403,7 +404,9 @@ public: if (remaining <= 0) { remaining = 0; timerRunning = false; + commonData->keydata[3].label = "-"; commonData->keydata[4].label = "START"; + showSelectionMarker = true; // Buzzer alarm (100% power) setBuzzerPower(100); buzzer(TONE2, 800); @@ -415,6 +418,7 @@ public: timerSeconds = timerStartSeconds; } else{ + commonData->keydata[3].label = ""; commonData->keydata[4].label = "RESET"; } int rem = static_cast(remaining); @@ -453,8 +457,8 @@ public: int16_t textX = (static_cast(getdisplay().width()) - static_cast(wb)) / 2; int16_t textY = centerY + hb / 2; - //getdisplay().setCursor(textX, textY); - getdisplay().setCursor(47, textY); + //getdisplay().setCursor(textX, textY); // horzontal jitter + getdisplay().setCursor(47, textY); // static X position getdisplay().print(timeStr); // Selection marker (only visible when not running and POS pressed) @@ -473,8 +477,8 @@ public: // Page label getdisplay().setFont(&Ubuntu_Bold16pt8b); - getdisplay().setCursor(65, 70); - getdisplay().print("Count Down Timer"); + getdisplay().setCursor(100, 70); + getdisplay().print("Regatta Timer"); } else if (mode == 'D') { // DIGITAL CLOCK MODE: large 7-segment time based on GPS/RTC @@ -521,8 +525,8 @@ public: int16_t x = (static_cast(getdisplay().width()) - static_cast(wb)) / 2; int16_t y = 150 + hb / 2; - //getdisplay().setCursor(x, y); - getdisplay().setCursor(47, y); + //getdisplay().setCursor(x, y); // horizontal jitter + getdisplay().setCursor(47, y); // static X position getdisplay().print(timeStr); // Display actual time // Small indicators: timezone and source