RTC: Fix counter value when CLEAR after STOP

If TASK_CLEAR was called after TASK_STOP the counter
value would not be cleared. Fix it.

Thanks to Lang Xie for the report.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2024-01-12 10:31:44 +01:00
parent a08acc7d3a
commit a5a4dfdac9
1 changed files with 1 additions and 0 deletions

View File

@ -534,6 +534,7 @@ static void nhw_rtc_TASKS_CLEAR(uint rtc) {
/* Pre-scaler value is latched to an internal register on tasks START, CLEAR, and TRIGOVRFLW */
nhw_rtc_st[rtc].PRESC = NRF_RTC_regs[rtc].PRESCALER;
nhw_rtc_st[rtc].counter_at_stop = 0;
nhw_rtc_set_counter(rtc, 0);
}