summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Trentini <matt.trentini@gmail.com>2022-08-09 00:56:50 +1000
committerDamien George <damien@micropython.org>2024-08-22 11:20:15 +1000
commite2c0e876f52d438fbdc286ab51cee92d5a24218e (patch)
treea85e1a080df8bfcce0405af52ca41b9452520196
parent185116ea4139e84e7f7afb27d52b14dc03f0c2a8 (diff)
stm32/rfcore: Allow HSE to be a wakeup source for BLE for the WB55.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
-rw-r--r--ports/stm32/rfcore.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ports/stm32/rfcore.c b/ports/stm32/rfcore.c
index 05582e887..2d99a3410 100644
--- a/ports/stm32/rfcore.c
+++ b/ports/stm32/rfcore.c
@@ -539,8 +539,12 @@ void rfcore_init(void) {
while (LL_HSEM_1StepLock(HSEM, CFG_HW_PWR_STANDBY_SEMID)) {
}
- // Select LSE as RF wakeup source
+ // Set the wakeup source to LSE or fall back to use HSE
+ #if MICROPY_HW_RTC_USE_LSE
RCC->CSR = (RCC->CSR & ~RCC_CSR_RFWKPSEL) | 1 << RCC_CSR_RFWKPSEL_Pos;
+ #else
+ RCC->CSR = (RCC->CSR & ~RCC_CSR_RFWKPSEL) | 3 << RCC_CSR_RFWKPSEL_Pos;
+ #endif
// Initialise IPCC and shared memory structures
ipcc_init(IRQ_PRI_SDIO);