Add software LiPo UV protection with energy-save boot.
Detect under-voltage on GPIO1/11, persist UV state in NVS, enter a minimal power mode without ESP-NOW, and recover after charge; expose LED mode 6 battery-low for host testing via goTool. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+9
-1
@@ -7,6 +7,10 @@
|
||||
#define LED_RING_DEFAULT_INTENSITY 13
|
||||
/** Full brightness for find-me and similar alerts. */
|
||||
#define LED_RING_FULL_INTENSITY 255
|
||||
/** ~10 % brightness for battery-low indicator. */
|
||||
#define LED_RING_BATTERY_LOW_INTENSITY 26
|
||||
#define LED_RING_BATTERY_LOW_LEDS 4
|
||||
#define LED_RING_BATTERY_LOW_HOLD_MS 5000
|
||||
|
||||
typedef enum {
|
||||
LED_CMD_CLEAR,
|
||||
@@ -14,7 +18,8 @@ typedef enum {
|
||||
LED_CMD_SET_COLOR,
|
||||
LED_CMD_PROGRESS,
|
||||
LED_CMD_BLINK,
|
||||
LED_CMD_FIND_ME
|
||||
LED_CMD_FIND_ME,
|
||||
LED_CMD_BATTERY_LOW
|
||||
} led_mode_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -45,4 +50,7 @@ void led_ring_ota_failed(void);
|
||||
/** Red / green / blue: 3 blinks each at full intensity. */
|
||||
void led_ring_find_me(void);
|
||||
|
||||
/** First 4 LEDs red at ~10 % for 5 s, then off (blocking in LED task). */
|
||||
void led_ring_show_battery_low(void);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user