|
PebbleOS
|
Power state control in response to battery state changes. More...
Functions | |
| void | battery_monitor_init (void) |
| Initialize the monitor and battery state tracking. | |
| void | battery_monitor_handle_state_change_event (PreciseBatteryChargeState state) |
| Update the power state after a battery state change. | |
| bool | battery_monitor_critical_lockout (void) |
| Check whether the UI must be locked out because the battery is critical. | |
| TimerID | battery_monitor_get_standby_timer_id (void) |
| Get the standby timer, for unit tests. | |
Power state control in response to battery state changes.
Enters low power mode below the board's low power threshold while discharging, and standby when the battery stays critical (0 % and not charging) for 30 s, or 2 s right after boot. Neither happens while plugged in, nor on QEMU outside recovery firmware.
| bool battery_monitor_critical_lockout | ( | void | ) |
Check whether the UI must be locked out because the battery is critical.
| TimerID battery_monitor_get_standby_timer_id | ( | void | ) |
Get the standby timer, for unit tests.
| void battery_monitor_handle_state_change_event | ( | PreciseBatteryChargeState | state | ) |
Update the power state after a battery state change.
Called on KernelMain for each PEBBLE_BATTERY_STATE_CHANGE_EVENT.
| state | New battery state. |
| void battery_monitor_init | ( | void | ) |
Initialize the monitor and battery state tracking.