Add runtime UV protection toggle and treat near-zero sense as external power.

Per-pod NVS enable (default off) via UART/ESP-NOW/dashboard, and skip UV latch when LiPo ADC reads ~0 mV so USB/external supply still boots.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-01 22:51:17 +01:00
co-authored by Cursor
parent c3b20887bf
commit 7f28a48a10
33 changed files with 1411 additions and 240 deletions
+7
View File
@@ -35,6 +35,13 @@ bool pod_settings_is_uv_latched(void);
esp_err_t pod_settings_set_uv_latched(bool latched);
esp_err_t pod_settings_clear_uv_latched(void);
/**
* Runtime enable for software UV protection (NVS). Missing key → disabled.
* Independent of POWERPOD_BATTERY_UV_ENABLE compile gate.
*/
bool pod_settings_is_uv_enabled(void);
esp_err_t pod_settings_set_uv_enabled(bool enabled);
/** Logical slave ids: 1…POD_CLIENT_ID_MAX (0 reserved for local master). */
#define POD_CLIENT_ID_MIN 1u
#define POD_CLIENT_ID_MAX 255u