From 4f52554eb3977a7da19161ea139906d95f2937c7 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 1 Apr 2021 20:53:25 -0400 Subject: [PATCH] Fix to RTC reset --- ports/stm/common-hal/alarm/__init__.c | 3 --- ports/stm/supervisor/port.c | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ports/stm/common-hal/alarm/__init__.c b/ports/stm/common-hal/alarm/__init__.c index 0cefc58834..9df19ed705 100644 --- a/ports/stm/common-hal/alarm/__init__.c +++ b/ports/stm/common-hal/alarm/__init__.c @@ -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) { - if (alarm_pin_pinalarm_woke_us_up()) { - return alarm_pin_pinalarm_get_wakeup_alarm(n_alarms, alarms); - } uint8_t cause = _get_wakeup_cause(); switch (cause) { case STM_WAKEUP_RTC: { diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 947bb7c3af..78c05fc98e 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -169,10 +169,9 @@ safe_mode_t port_init(void) { HAL_Init(); // Turns on SysTick __HAL_RCC_SYSCFG_CLK_ENABLE(); - #if (CPY_STM32F4) __HAL_RCC_PWR_CLK_ENABLE(); - #endif + HAL_PWR_EnableBkUpAccess(); __HAL_RCC_BACKUPRESET_FORCE(); __HAL_RCC_BACKUPRESET_RELEASE();