added solar ina handling, adjusted website
This commit is contained in:
@@ -756,13 +756,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
|
||||
|
||||
Reference in New Issue
Block a user