Skip to content

Commit 6af8090

Browse files
committed
cpu/nrf5x_common: properly calibrate RC-based low-frequency clock
1 parent bea466f commit 6af8090

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cpu/nrf5x_common/clock.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ void clock_start_lf(void)
103103
clock_lf_running = true;
104104

105105
/* calibrate the RC LF clock if applicable */
106-
#if (CLOCK_HFCLK && (CLOCK_LFCLK == 0))
106+
#if (CLOCK_LFCLK == CLOCK_LFCLKSRC_SRC_RC)
107+
clock_hfxo_request();
107108
NRF_CLOCK->EVENTS_DONE = 0;
108109
NRF_CLOCK->TASKS_CAL = 1;
109110
while (NRF_CLOCK->EVENTS_DONE == 0) {}
111+
clock_hfxo_release();
110112
#endif
111113
}
112114

0 commit comments

Comments
 (0)