1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-02-11 07:03:07 +01:00

Fix for PageClock

This commit is contained in:
norbert-walter
2026-02-06 15:20:43 +01:00
parent 6870c9b8a4
commit ef4546a2e6

View File

@@ -184,12 +184,18 @@ public:
incrementSelected(); incrementSelected();
return 0; return 0;
} }
if (key == 3 && timerRunning) { // No action if timer running
return 0;
}
// - (K4): decrement selected field (only if timer not running) // - (K4): decrement selected field (only if timer not running)
if (key == 4 && !timerRunning) { if (key == 4 && !timerRunning) {
decrementSelected(); decrementSelected();
return 0; return 0;
} }
if (key == 4 && timerRunning) { // No action if timer running
return 0;
}
// RUN (K5): start/stop timer // RUN (K5): start/stop timer
if (key == 5) { if (key == 5) {
@@ -366,10 +372,10 @@ public:
struct tm rtcCopy = commonData->data.rtcTime; struct tm rtcCopy = commonData->data.rtcTime;
time_t nowEpoch = mktime(&rtcCopy); time_t nowEpoch = mktime(&rtcCopy);
time_t remaining = timerEndEpoch - nowEpoch; time_t remaining = timerEndEpoch - nowEpoch;
if(remaining <= 5){ if(remaining <= 5 && remaining != 0){
// Short buzzer alarm (100% power) // Short pre buzzer alarm (100% power)
setBuzzerPower(100); setBuzzerPower(100);
buzzer(TONE4, 75); buzzer(TONE2, 75);
setBuzzerPower(config->getInt(config->buzzerPower)); setBuzzerPower(config->getInt(config->buzzerPower));
} }
if (remaining <= 0) { if (remaining <= 0) {
@@ -378,7 +384,7 @@ public:
commonData->keydata[4].label = "START"; commonData->keydata[4].label = "START";
// Buzzer alarm (100% power) // Buzzer alarm (100% power)
setBuzzerPower(100); setBuzzerPower(100);
buzzer(TONE4, 800); buzzer(TONE2, 800);
setBuzzerPower(config->getInt(config->buzzerPower)); setBuzzerPower(config->getInt(config->buzzerPower));
// When countdown is finished, restore the initial start time // When countdown is finished, restore the initial start time
@@ -492,20 +498,21 @@ public:
int16_t x = (static_cast<int16_t>(getdisplay().width()) - static_cast<int16_t>(wb)) / 2; int16_t x = (static_cast<int16_t>(getdisplay().width()) - static_cast<int16_t>(wb)) / 2;
int16_t y = 150 + hb / 2; int16_t y = 150 + hb / 2;
getdisplay().setCursor(x, y); //getdisplay().setCursor(x, y);
getdisplay().setCursor(47, y);
getdisplay().print(timeStr); // Display actual time getdisplay().print(timeStr); // Display actual time
// Small indicators: timezone and source // Small indicators: timezone and source
getdisplay().setFont(&Ubuntu_Bold8pt8b); getdisplay().setFont(&Ubuntu_Bold8pt8b);
getdisplay().setCursor(x, 110); getdisplay().setCursor(47, 110);
if (source == 'G') { if (source == 'G') {
getdisplay().print("GPS"); getdisplay().print("GPS");
} else { } else {
getdisplay().print("RTC"); getdisplay().print("RTC");
} }
getdisplay().setCursor(x + 40, 110); getdisplay().setCursor(47 + 40, 110);
if (holdvalues == false) { if (holdvalues == false) {
getdisplay().print(tz == 'L' ? "LOT" : "UTC"); getdisplay().print(tz == 'L' ? "LOT" : "UTC");
} else { } else {