diff options
author | Christoph Honal <christoph.honal@web.de> | 2022-05-25 15:00:19 +0200 |
---|---|---|
committer | Riku Isokoski <riksu9000@gmail.com> | 2022-06-27 08:28:48 +0300 |
commit | e77d47e35c84e2942f689fd2a810bda0b7dce625 (patch) | |
tree | 253362574c8267d6ececd164d3f9de9ce2a2f4b3 /src/main.cpp | |
parent | 8b0559c4812d74b6307757135622975523c5a88d (diff) |
LFCLK: Add compatibility to wasp-os reloader-factory
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 98d8cafb..109971bc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -312,10 +312,15 @@ int main(void) { nrf_drv_clock_init(); nrf_drv_clock_lfclk_request(NULL); -// The RC source for the LF clock has to be calibrated -#if (CLOCK_CONFIG_LF_SRC == NRF_CLOCK_LFCLK_RC) + // When loading the firmware via the Wasp-OS reloader-factory, which uses the used internal LF RC oscillator, + // the LF clock has to be explicitly restarted because InfiniTime uses the external crystal oscillator if available. + // If the clock is not restarted, the Bluetooth timers fail to initialize. + nrfx_clock_lfclk_start(); while (!nrf_clock_lf_is_running()) { } + +// The RC source for the LF clock has to be calibrated +#if (CLOCK_CONFIG_LF_SRC == NRF_CLOCK_LFCLK_RC) nrf_drv_clock_calibration_start(0, calibrate_lf_clock_rc); #endif |