add awake and charge indicator led functions

This commit is contained in:
2025-02-28 22:07:20 +01:00
parent 59d27ab0b8
commit 3cf9298756
2 changed files with 15 additions and 0 deletions

View File

@@ -180,6 +180,8 @@ struct PlantStateMQTT<'a> {
next_pump: &'a str,
}
fn safe_main() -> anyhow::Result<()> {
// It is necessary to call this function once. Otherwise some patches to the runtime
// implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71
@@ -256,7 +258,9 @@ fn safe_main() -> anyhow::Result<()> {
log(log::LogMessage::YearInplausibleForceConfig, 0,0,"","");
}
println!("cur is {}", cur);
board.update_charge_indicator();
if board.get_restart_to_conf() {
log(log::LogMessage::ConfigModeSoftwareOverride, 0,0,"","");
@@ -941,6 +945,7 @@ fn wait_infinity(wait_type: WaitType, reboot_now: Arc<AtomicBool>) -> ! {
led_count += 1;
};
unsafe {
BOARD_ACCESS.lock().unwrap().update_charge_indicator();
//do not trigger watchdog
for i in 0..8 {
BOARD_ACCESS.lock().unwrap().fault(i, i < led_count);