mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-02-10 22:53:07 +01:00
Modify reagatta timer funktion
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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<int>(remaining);
|
||||
@@ -453,8 +457,8 @@ public:
|
||||
int16_t textX = (static_cast<int16_t>(getdisplay().width()) - static_cast<int16_t>(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<int16_t>(getdisplay().width()) - static_cast<int16_t>(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
|
||||
|
||||
Reference in New Issue
Block a user