Rename -> Inst. Cluster (user); power manager: deep sleep on link silence, wake on IO1 or 60 s probe boot; Ota::isBusy; sleep bit in shared header
Firmware / build (push) Successful in 2m59s

This commit is contained in:
2026-09-28 16:38:23 +02:00
parent 43697f3cc8
commit 6854aa1c46
33 changed files with 266 additions and 97 deletions
+41
View File
@@ -0,0 +1,41 @@
/**
* Power Manager (Inst. Cluster) - deep sleep when the Main CTRL goes quiet.
*
* Controlled from the Main CTRL's Settings switch "Sleep when the car is off":
* it arrives as the CFG_SLEEP_WHEN_SILENT bit of the CONFIG frame and is
* cached in NVS with the rest of the gauge config, so it is known even while
* the Main CTRL is already asleep.
*
* Sleep when: the bit is set, no DATA frame on any transport for
* SLEEP_AFTER_MS, no update job running, up for at least SLEEP_AFTER_MS.
* Gauges are driven low and the backlight off first.
*
* Wake:
* - UART RX (IO1, RTC IO) goes low: the Main CTRL's first frame on the wire
* - a timer every PROBE_PERIOD_S: a short "probe boot" with the backlight
* off that listens for ESP-NOW frames for a few seconds and goes straight
* back to sleep if nothing arrives. This is what wakes the board when the
* link is radio-only (no wire in the car).
*
* Console: sleep status | now
*/
#ifndef POWER_MANAGER_H
#define POWER_MANAGER_H
#include <Arduino.h>
namespace PowerManager {
/** Right after DisplayInit::init(): detects a probe boot and keeps the panel dark. */
void init();
/** True during a timer-wake probe boot (setup() skips its waits). */
bool isProbeBoot();
void tick();
bool handleCommand(const char* line);
} // namespace PowerManager
#endif // POWER_MANAGER_H