Skip to content

Commit dd8e4c1

Browse files
authored
Merge pull request embassy-rs#6077 from freedrop-golf/grtc-reset-fix
Fix grtc syscounter reset on init
2 parents 20cdf16 + 8c9a288 commit dd8e4c1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

embassy-nrf/src/time_driver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,10 @@ impl RtcDriver {
218218
r.events_compare(n).write_value(0);
219219
r.intenclr(DOMAIN_IDX).write(|w| w.0 = compare_n(n));
220220

221-
// 3. Clear and start the counter.
221+
// 3. Clear and start the counter when lftimer is ready
222+
while !r.status().lftimer().read().ready() {}
222223
r.tasks_clear().write_value(1);
224+
while !r.status().lftimer().read().ready() {}
223225
r.tasks_start().write_value(1);
224226

225227
// 4. Configure the sleep/wake mechanism and enable the SYSCOUNTER.

0 commit comments

Comments
 (0)