fix(time): apply timezone before lcd startup

This commit is contained in:
chenjintao
2026-08-25 09:55:39 +08:00
parent ceb0780425
commit f33ad70c16
7 changed files with 57 additions and 5 deletions
+3
View File
@@ -237,12 +237,15 @@ esp_err_t platform_storage_erase(const char *ns, const char *key);
/**
* @brief Wall-clock time synchronization (SNTP) primitives.
*
* - `platform_time_set_timezone()` applies the process-local POSIX time zone
* without starting SNTP. Call it during boot before local time is rendered.
* - `platform_time_sync_start()` is idempotent: it sets the process time zone
* (`posix_tz`, e.g. "CST-8"; ignored when NULL/empty) on every call and
* starts the SNTP client once. Must be called after the network is up.
* - `platform_time_is_synced()` reports whether the system clock has advanced
* past a sane epoch lower bound (i.e. SNTP has set the time at least once).
*/
esp_err_t platform_time_set_timezone(const char *posix_tz);
esp_err_t platform_time_sync_start(const char *sntp_server, const char *posix_tz);
bool platform_time_is_synced(void);