From 337214d6500be838415126ec7bc38af7d3cb5dca Mon Sep 17 00:00:00 2001 From: norbert-walter Date: Wed, 4 Feb 2026 16:48:50 +0100 Subject: [PATCH] Fix config problem for OBP60, missing setup values --- lib/obp60task/PageClock.cpp | 32 ++++++++++++++++++-------------- lib/obp60task/config_obp60.json | 4 ++-- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/lib/obp60task/PageClock.cpp b/lib/obp60task/PageClock.cpp index a0be7d7..7c7b74f 100644 --- a/lib/obp60task/PageClock.cpp +++ b/lib/obp60task/PageClock.cpp @@ -19,7 +19,12 @@ class PageClock : public Page bool simulation = false; int simtime; 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 +#endif char mode = 'A'; // display mode (A)nalog | (D)igital | race (T)imer 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 @@ -50,29 +55,28 @@ bool homevalid = false; // homelat and homelon are valid virtual int handleKey(int key){ // Time source if (key == 1) { - if (source == 'G') { - source = 'R'; - } else { - source = 'G'; + switch (source) { + case 'G': source = 'R'; break; + case 'R': source = 'G'; break; + default: source = 'G'; break; } return 0; } if (key == 2) { - if (mode == 'A') { - mode = 'D'; - } else if (mode == 'D') { - mode = 'T'; - } else { - mode = 'A'; + switch (mode) { + case 'A': mode = 'D'; break; + case 'D': mode = 'T'; break; + case 'T': mode = 'A'; break; + default: mode = 'A'; break; } return 0; } // Time zone: Local / UTC if (key == 5) { - if (tz == 'L') { - tz = 'U'; - } else { - tz = 'L'; + switch (tz) { + case 'L': tz = 'U'; break; + case 'U': tz = 'L'; break; + default: tz = 'L'; break; } return 0; } diff --git a/lib/obp60task/config_obp60.json b/lib/obp60task/config_obp60.json index 2aa21fa..8318af7 100644 --- a/lib/obp60task/config_obp60.json +++ b/lib/obp60task/config_obp60.json @@ -37,7 +37,7 @@ "name": "homeLAT", "label": "Home latitude", "type": "number", - "default": "", + "default": "0.00000", "check": "checkMinMax", "min": -90.0, "max": 90.0, @@ -51,7 +51,7 @@ "name": "homeLON", "label": "Home longitude", "type": "number", - "default": "", + "default": "0.00000", "check": "checkMinMax", "min": -180.0, "max": 180.0,