From 102b77a7a308e4106284b4a69b5cacd9569bccc9 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Thu, 25 May 2023 20:52:17 +0100 Subject: [PATCH] Fix BLE panic 071 --- model/MicroBit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/model/MicroBit.cpp b/model/MicroBit.cpp index ad9a2e53..348d490b 100644 --- a/model/MicroBit.cpp +++ b/model/MicroBit.cpp @@ -284,9 +284,13 @@ int MicroBit::init() #endif // Bring up the 64MHz external oscillator. +#if CONFIG_ENABLED(DEVICE_BLE) && CONFIG_ENABLED(MICROBIT_BLE_ENABLED) + sd_clock_hfclk_request(); +#else NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; NRF_CLOCK->TASKS_HFCLKSTART = 1; while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0); +#endif // Deschedule for a little while, just to allow for any components that finialise initialisation // as a background task, and to allow the power mamanger to repsonse to background events from the KL27