mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-02-11 07:03: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
|
N2K = GPS time on N2K od 183 bus
|
||||||
0 = device not ready
|
0 = device not ready
|
||||||
1 = device ready
|
1 = device ready
|
||||||
X = undependend
|
X = independend
|
||||||
() = source for set time N2K
|
() = source for set time N2K
|
||||||
-> = set RTC via iRTC
|
-> = set RTC via iRTC
|
||||||
<- = set RTC via GPS
|
<- = 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 RTC DS1388 ready, then copy iRTC and GPS data to RTC all 1min
|
||||||
if(millis() > starttime11 + 5*60*1000){
|
if(millis() > starttime11 + 1*60*1000){
|
||||||
starttime11 = millis();
|
starttime11 = millis();
|
||||||
// Set RTC chip via iRTC (NTP)
|
// Set RTC chip via iRTC (NTP)
|
||||||
if(iRTC_ready == true && RTC_ready == true && GPS_ready == false){
|
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
|
// Send RTC date and time to N2K all 500ms
|
||||||
if (millis() > starttime12 + 500) {
|
if (millis() > starttime12 + 500) {
|
||||||
starttime12 = millis();
|
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) {
|
if (rtcOn == "DS1388" && RTC_ready) {
|
||||||
DateTime dt = ds1388.now();
|
DateTime dt = ds1388.now();
|
||||||
sensors.rtcTime.tm_year = dt.year() - 1900; // Save values in SensorData
|
sensors.rtcTime.tm_year = dt.year() - 1900; // Save values in SensorData
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ public:
|
|||||||
timerHours = timerStartHours;
|
timerHours = timerStartHours;
|
||||||
timerMinutes = timerStartMinutes;
|
timerMinutes = timerStartMinutes;
|
||||||
timerSeconds = timerStartSeconds;
|
timerSeconds = timerStartSeconds;
|
||||||
commonData->keydata[4].label = "RESET";
|
// commonData->keydata[4].label = "RESET";
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -242,6 +242,7 @@ public:
|
|||||||
timerMinutes = timerStartMinutes;
|
timerMinutes = timerStartMinutes;
|
||||||
timerSeconds = timerStartSeconds;
|
timerSeconds = timerStartSeconds;
|
||||||
timerRunning = false;
|
timerRunning = false;
|
||||||
|
showSelectionMarker = true;
|
||||||
// marker will become visible again only after POS press
|
// marker will become visible again only after POS press
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -403,7 +404,9 @@ public:
|
|||||||
if (remaining <= 0) {
|
if (remaining <= 0) {
|
||||||
remaining = 0;
|
remaining = 0;
|
||||||
timerRunning = false;
|
timerRunning = false;
|
||||||
|
commonData->keydata[3].label = "-";
|
||||||
commonData->keydata[4].label = "START";
|
commonData->keydata[4].label = "START";
|
||||||
|
showSelectionMarker = true;
|
||||||
// Buzzer alarm (100% power)
|
// Buzzer alarm (100% power)
|
||||||
setBuzzerPower(100);
|
setBuzzerPower(100);
|
||||||
buzzer(TONE2, 800);
|
buzzer(TONE2, 800);
|
||||||
@@ -415,6 +418,7 @@ public:
|
|||||||
timerSeconds = timerStartSeconds;
|
timerSeconds = timerStartSeconds;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
commonData->keydata[3].label = "";
|
||||||
commonData->keydata[4].label = "RESET";
|
commonData->keydata[4].label = "RESET";
|
||||||
}
|
}
|
||||||
int rem = static_cast<int>(remaining);
|
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 textX = (static_cast<int16_t>(getdisplay().width()) - static_cast<int16_t>(wb)) / 2;
|
||||||
int16_t textY = centerY + hb / 2;
|
int16_t textY = centerY + hb / 2;
|
||||||
|
|
||||||
//getdisplay().setCursor(textX, textY);
|
//getdisplay().setCursor(textX, textY); // horzontal jitter
|
||||||
getdisplay().setCursor(47, textY);
|
getdisplay().setCursor(47, textY); // static X position
|
||||||
getdisplay().print(timeStr);
|
getdisplay().print(timeStr);
|
||||||
|
|
||||||
// Selection marker (only visible when not running and POS pressed)
|
// Selection marker (only visible when not running and POS pressed)
|
||||||
@@ -473,8 +477,8 @@ public:
|
|||||||
|
|
||||||
// Page label
|
// Page label
|
||||||
getdisplay().setFont(&Ubuntu_Bold16pt8b);
|
getdisplay().setFont(&Ubuntu_Bold16pt8b);
|
||||||
getdisplay().setCursor(65, 70);
|
getdisplay().setCursor(100, 70);
|
||||||
getdisplay().print("Count Down Timer");
|
getdisplay().print("Regatta Timer");
|
||||||
|
|
||||||
} else if (mode == 'D') {
|
} else if (mode == 'D') {
|
||||||
// DIGITAL CLOCK MODE: large 7-segment time based on GPS/RTC
|
// 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 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); // horizontal jitter
|
||||||
getdisplay().setCursor(47, y);
|
getdisplay().setCursor(47, y); // static X position
|
||||||
getdisplay().print(timeStr); // Display actual time
|
getdisplay().print(timeStr); // Display actual time
|
||||||
|
|
||||||
// Small indicators: timezone and source
|
// Small indicators: timezone and source
|
||||||
|
|||||||
Reference in New Issue
Block a user