Api-hal-power: reset routine. Power: safe to poweroff message, cleanup. (#436)

This commit is contained in:
あく
2021-04-30 07:51:48 +03:00
committed by GitHub
parent eb82748d50
commit 43ff095724
8 changed files with 77 additions and 38 deletions

View File

@@ -57,9 +57,12 @@ uint8_t api_hal_power_get_bat_health_pct();
/** Get charging status */
bool api_hal_power_is_charging();
/** Poweroff system */
/** Poweroff device */
void api_hal_power_off();
/** Reset device */
void api_hal_power_reset();
/** OTG enable */
void api_hal_power_enable_otg();

View File

@@ -48,7 +48,7 @@ const ParamCEDV cedv = {
void HAL_RCC_CSSCallback(void) {
// TODO: notify user about issue with HSE
NVIC_SystemReset();
api_hal_power_reset();
}
void api_hal_power_init() {
@@ -150,6 +150,10 @@ void api_hal_power_off() {
bq25896_poweroff();
}
void api_hal_power_reset() {
NVIC_SystemReset();
}
void api_hal_power_enable_otg() {
bq25896_enable_otg();
}