Merge branch 'develop' into housekeeping

This commit is contained in:
2025-06-20 23:40:32 +02:00
16 changed files with 312 additions and 54 deletions

View File

@@ -754,13 +754,24 @@ fn wait_infinity(wait_type: WaitType, reboot_now: Arc<AtomicBool>) -> ! {
loop {
unsafe {
let mut board = BOARD_ACCESS.lock().unwrap();
if let Ok(charging) = board
//we have mppt controller, ask it for charging current
if let Ok(current) = board.board_hal.get_mptt_current() {
let _ = board.board_hal.set_charge_indicator(current.as_milliamperes() > 20_f64);
}
//fallback to battery controller and ask it instead
else if let Ok(charging) = board
.board_hal
.get_battery_monitor()
.average_current_milli_ampere()
{
let _ = board.board_hal.set_charge_indicator(charging > 20);
}
else {
//who knows
let _ = board.board_hal.set_charge_indicator(false);
}
match wait_type {
WaitType::MissingConfig => {
// Keep existing behavior: circular filling pattern