8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7000e0a commit 87e1616Copy full SHA for 87e1616
nrf5/hal/hal_rtc.c
@@ -39,6 +39,13 @@ void hal_rtc_callback_set(hal_rtc_app_callback callback) {
39
void hal_rtc_init(hal_rtc_conf_t const * p_rtc_conf) {
40
p_rtc_conf->p_instance->PRESCALER = (32768 / p_rtc_conf->frequency) - 1; // approx correct.
41
hal_irq_priority(p_rtc_conf->irq_num, p_rtc_conf->irq_priority);
42
+
43
+ // start LFCLK if not already started
44
+ if (NRF_CLOCK->LFCLKSTAT == 0) {
45
+ NRF_CLOCK->TASKS_LFCLKSTART = 1;
46
+ while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0);
47
+ NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
48
+ }
49
}
50
51
void hal_rtc_start(hal_rtc_conf_t const * p_rtc_conf, uint16_t period) {
0 commit comments