Do not spin when battery is unplugged

This commit is contained in:
o9000 2018-01-19 23:20:44 +00:00
parent f5f8792d42
commit 04ba5a6617

View file

@ -225,7 +225,8 @@ void init_battery()
battery_found = battery_os_init(); battery_found = battery_os_init();
change_timer(&battery_timer, true, battery_found ? 10 : 30000, 30000, update_battery_tick, 0); if (!battery_timer.enabled_)
change_timer(&battery_timer, true, 30000, 30000, update_battery_tick, 0);
update_battery(); update_battery();
} }
@ -272,6 +273,7 @@ void init_battery_panel(void *p)
bat1_format = strdup("%p"); bat1_format = strdup("%p");
bat2_format = strdup("%t"); bat2_format = strdup("%t");
} }
update_battery_tick(NULL);
} }
void battery_init_fonts() void battery_init_fonts()