v1.7.1: GPS time sync, timezone picker, status bar clock

- GPS time sync via UBlox MIA-M10Q (38400 baud auto-detect)
- Custom zero-dependency NMEA parser with XOR checksum validation
- Only trust GPS time when satellites > 0 (no stale RTC cache)
- DST-aware timezone picker at first boot (21 cities, POSIX TZ strings)
- Timezone also configurable in Settings > GPS/Time
- GPS Time on by default, GPS Location off by default (opt-in)
- Status bar: clock (top-left), Ratspeak.org (center), battery (right)
- 12h time default (no AM/PM), configurable 24h in settings
- NVS persistence of GPS time for approximate timestamps across reboots
- Fix factory reset Enter key bleed-through (600ms input guard)
- Fix hardcoded UTC-5 NTP timezone (now uses DST-aware POSIX TZ)
This commit is contained in:
DeFiDude committed 2026-03-25 02:42:18 -06:00
1 parent 311c5ad3df
commit b2fcfe526e
15 files changed
+340 -87

No files matched your search

+13 -8
View File
@@ -3,6 +3,7 @@
#include "ui/LvTheme.h"
#include "config/Config.h"
#include "config/UserConfig.h"
#include "ui/screens/LvTimezoneScreen.h" // For TIMEZONE_TABLE
#include "storage/FlashStore.h"
#include "storage/SDStore.h"
#include "radio/SX1262.h"
@@ -382,10 +383,14 @@ void LvSettingsScreen::buildItems() {
[](int v) { return v ? String("ON") : String("OFF"); }});
idx++;
#endif
_items.push_back({"UTC Offset", SettingType::INTEGER,
[&s]() { return (int)s.utcOffset; }, [&s](int v) { s.utcOffset = (int8_t)v; },
[](int v) { char buf[8]; snprintf(buf, sizeof(buf), "UTC%+d", v); return String(buf); },
-12, 14, 1});
_items.push_back({"Timezone", SettingType::INTEGER,
[&s]() { return (int)s.timezoneIdx; },
[&s](int v) { s.timezoneIdx = (uint8_t)v; s.timezoneSet = true; },
[](int v) {
if (v >= 0 && v < TIMEZONE_COUNT) return String(TIMEZONE_TABLE[v].label);
return String("Unknown");
},
0, TIMEZONE_COUNT - 1, 1});
idx++;
_items.push_back({"24h Time", SettingType::TOGGLE,
[&s]() { return s.use24HourTime ? 1 : 0; },
@@ -394,9 +399,9 @@ void LvSettingsScreen::buildItems() {
idx++;
_categories.push_back({"GPS/Time", gpsStart, idx - gpsStart,
[&s]() {
char buf[16];
snprintf(buf, sizeof(buf), "UTC%+d", s.utcOffset);
return String(buf);
if (s.timezoneIdx < TIMEZONE_COUNT)
return String(TIMEZONE_TABLE[s.timezoneIdx].label);
return String("Not set");
}});
// Audio
@@ -540,7 +545,7 @@ void LvSettingsScreen::buildItems() {
if (_sd && _sd->isReady()) _sd->wipeRatputer();
if (_flash) _flash->format();
nvs_flash_erase();
delay(500);
delay(1500); // Long enough for key state to clear before reboot
ESP.restart();
};
_items.push_back(factoryReset);