Skip to content

Commit ede64d6

Browse files
nordic-krchcarlescufi
authored andcommitted
drivers: counter: Fix default top value callback in counter_nrfx_rtc.c
In case of default top value, driver was calling top value callback only on the first period. This was not expected behavior. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent 67d90fd commit ede64d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/counter/counter_nrfx_rtc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,11 @@ static void event_handler(nrfx_rtc_int_type_t int_type, void *p_context)
172172
/* Manually reset counter if top value is different than max. */
173173
if (data->top != COUNTER_MAX_TOP_VALUE) {
174174
nrfx_rtc_counter_clear(&get_nrfx_config(dev)->rtc);
175-
nrfx_rtc_cc_set(&get_nrfx_config(dev)->rtc,
176-
TOP_CH, data->top, true);
177175
}
178176

177+
nrfx_rtc_cc_set(&get_nrfx_config(dev)->rtc,
178+
TOP_CH, data->top, true);
179+
179180
if (data->top_cb) {
180181
data->top_cb(dev, data->top_user_data);
181182
}

0 commit comments

Comments
 (0)