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

Fix config problem for OBP60, missing setup values

This commit is contained in:
norbert-walter
2026-02-04 16:48:50 +01:00
parent 744cf6469b
commit 337214d650
2 changed files with 20 additions and 16 deletions

View File

@@ -19,7 +19,12 @@ class PageClock : public Page
bool simulation = false; bool simulation = false;
int simtime; int simtime;
bool keylock = false; bool keylock = false;
#ifdef BOARD_OBP60S3
char source = 'G'; // time source (R)TC | (G)PS | (N)TP
#endif
#ifdef BOARD_OBP40S3
char source = 'R'; // time source (R)TC | (G)PS | (N)TP char source = 'R'; // time source (R)TC | (G)PS | (N)TP
#endif
char mode = 'A'; // display mode (A)nalog | (D)igital | race (T)imer char mode = 'A'; // display mode (A)nalog | (D)igital | race (T)imer
char tz = 'L'; // time zone (L)ocal | (U)TC char tz = 'L'; // time zone (L)ocal | (U)TC
double timezone = 0; // there are timezones with non int offsets, e.g. 5.5 or 5.75 double timezone = 0; // there are timezones with non int offsets, e.g. 5.5 or 5.75
@@ -50,29 +55,28 @@ bool homevalid = false; // homelat and homelon are valid
virtual int handleKey(int key){ virtual int handleKey(int key){
// Time source // Time source
if (key == 1) { if (key == 1) {
if (source == 'G') { switch (source) {
source = 'R'; case 'G': source = 'R'; break;
} else { case 'R': source = 'G'; break;
source = 'G'; default: source = 'G'; break;
} }
return 0; return 0;
} }
if (key == 2) { if (key == 2) {
if (mode == 'A') { switch (mode) {
mode = 'D'; case 'A': mode = 'D'; break;
} else if (mode == 'D') { case 'D': mode = 'T'; break;
mode = 'T'; case 'T': mode = 'A'; break;
} else { default: mode = 'A'; break;
mode = 'A';
} }
return 0; return 0;
} }
// Time zone: Local / UTC // Time zone: Local / UTC
if (key == 5) { if (key == 5) {
if (tz == 'L') { switch (tz) {
tz = 'U'; case 'L': tz = 'U'; break;
} else { case 'U': tz = 'L'; break;
tz = 'L'; default: tz = 'L'; break;
} }
return 0; return 0;
} }

View File

@@ -37,7 +37,7 @@
"name": "homeLAT", "name": "homeLAT",
"label": "Home latitude", "label": "Home latitude",
"type": "number", "type": "number",
"default": "", "default": "0.00000",
"check": "checkMinMax", "check": "checkMinMax",
"min": -90.0, "min": -90.0,
"max": 90.0, "max": 90.0,
@@ -51,7 +51,7 @@
"name": "homeLON", "name": "homeLON",
"label": "Home longitude", "label": "Home longitude",
"type": "number", "type": "number",
"default": "", "default": "0.00000",
"check": "checkMinMax", "check": "checkMinMax",
"min": -180.0, "min": -180.0,
"max": 180.0, "max": 180.0,