Fix to RTC reset
This commit is contained in:
parent
33418ce826
commit
4f52554eb3
|
@ -79,9 +79,6 @@ bool common_hal_alarm_woken_from_sleep(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC mp_obj_t _get_wake_alarm(size_t n_alarms, const mp_obj_t *alarms) {
|
STATIC mp_obj_t _get_wake_alarm(size_t n_alarms, const mp_obj_t *alarms) {
|
||||||
if (alarm_pin_pinalarm_woke_us_up()) {
|
|
||||||
return alarm_pin_pinalarm_get_wakeup_alarm(n_alarms, alarms);
|
|
||||||
}
|
|
||||||
uint8_t cause = _get_wakeup_cause();
|
uint8_t cause = _get_wakeup_cause();
|
||||||
switch (cause) {
|
switch (cause) {
|
||||||
case STM_WAKEUP_RTC: {
|
case STM_WAKEUP_RTC: {
|
||||||
|
|
|
@ -169,10 +169,9 @@ safe_mode_t port_init(void) {
|
||||||
HAL_Init(); // Turns on SysTick
|
HAL_Init(); // Turns on SysTick
|
||||||
__HAL_RCC_SYSCFG_CLK_ENABLE();
|
__HAL_RCC_SYSCFG_CLK_ENABLE();
|
||||||
|
|
||||||
#if (CPY_STM32F4)
|
|
||||||
__HAL_RCC_PWR_CLK_ENABLE();
|
__HAL_RCC_PWR_CLK_ENABLE();
|
||||||
#endif
|
|
||||||
|
|
||||||
|
HAL_PWR_EnableBkUpAccess();
|
||||||
__HAL_RCC_BACKUPRESET_FORCE();
|
__HAL_RCC_BACKUPRESET_FORCE();
|
||||||
__HAL_RCC_BACKUPRESET_RELEASE();
|
__HAL_RCC_BACKUPRESET_RELEASE();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue