Skip to content

drivers: counter: Fix default top value callback in counter_nrfx_rtc.c #12815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions drivers/counter/counter_nrfx_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ static void event_handler(nrfx_rtc_int_type_t int_type, void *p_context)
/* Manually reset counter if top value is different than max. */
if (data->top != COUNTER_MAX_TOP_VALUE) {
nrfx_rtc_counter_clear(&get_nrfx_config(dev)->rtc);
nrfx_rtc_cc_set(&get_nrfx_config(dev)->rtc,
TOP_CH, data->top, true);
}

nrfx_rtc_cc_set(&get_nrfx_config(dev)->rtc,
TOP_CH, data->top, true);

if (data->top_cb) {
data->top_cb(dev, data->top_user_data);
}
Expand Down