Enhance battery detection and configuration handling (#3197)

* indicate batt changed event
* added sleep config, and use it.
* reinit if new batt detected.
* more detect
* repl batt setting
* disabled some things
* copilot fixes
This commit is contained in:
Totoo
2026-06-11 10:52:20 +02:00
committed by GitHub
parent 9042d1c433
commit 6b5955e0b5
16 changed files with 154 additions and 67 deletions
+5 -2
View File
@@ -1610,17 +1610,20 @@ class BatteryStateMessage : public Message {
uint8_t valid_mask,
uint8_t percent,
bool on_charger,
uint16_t voltage)
uint16_t voltage,
bool battMayChanged)
: Message{ID::BatteryStateData},
valid_mask{valid_mask},
percent{percent},
on_charger{on_charger},
voltage{voltage} {
voltage{voltage},
battMayChanged{battMayChanged} {
}
uint8_t valid_mask = 0;
uint8_t percent = 0;
bool on_charger = false;
uint16_t voltage = 0; // mV
bool battMayChanged = false;
};
class ProtoViewDataMessage : public Message {