mod: add clock settings tab, timezone support, and clock size option
Fix clock persistence bug caused by stale legacy read in settings deserialization. Add clock size setting (Small/Medium/Large) and timezone selection with North American presets plus custom UTC offset. Move all clock-related settings into a dedicated Clock tab, rename "Home Screen Clock" to "Clock", and move minute-change detection to main loop so the header clock updates on every screen. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include "CrossPointSettings.h"
|
||||
|
||||
namespace TimeSync {
|
||||
|
||||
void startNtpSync() {
|
||||
@@ -12,6 +16,10 @@ void startNtpSync() {
|
||||
esp_sntp_stop();
|
||||
}
|
||||
|
||||
// Apply timezone so NTP-synced time is displayed correctly
|
||||
setenv("TZ", SETTINGS.getTimezonePosixStr(), 1);
|
||||
tzset();
|
||||
|
||||
esp_sntp_setoperatingmode(ESP_SNTP_OPMODE_POLL);
|
||||
esp_sntp_setservername(0, "pool.ntp.org");
|
||||
esp_sntp_init();
|
||||
|
||||
Reference in New Issue
Block a user