Skip to content

Commit

Permalink
Merge pull request RIOT-OS#20669 from mguetschow/nrf52-lfclk_rc-calib…
Browse files Browse the repository at this point in the history
…rate

cpu/nrf5x_common: properly calibrate RC-based low-frequency clock
  • Loading branch information
maribu authored May 14, 2024
2 parents 12180f5 + 6af8090 commit 28beadd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cpu/nrf5x_common/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ void clock_start_lf(void)
clock_lf_running = true;

/* calibrate the RC LF clock if applicable */
#if (CLOCK_HFCLK && (CLOCK_LFCLK == 0))
#if (CLOCK_LFCLK == CLOCK_LFCLKSRC_SRC_RC)
clock_hfxo_request();
NRF_CLOCK->EVENTS_DONE = 0;
NRF_CLOCK->TASKS_CAL = 1;
while (NRF_CLOCK->EVENTS_DONE == 0) {}
clock_hfxo_release();
#endif
}

Expand Down

0 comments on commit 28beadd

Please sign in to comment.