Skip to content

Commit fba7c3e

Browse files
Holt-Sunnashif
authored andcommitted
drivers: counter: fix mcux lptmr unit test issue.
The counter alarm irq shall set the match value to the max top value after stopping the timer, otherwise the next start of the lptmr counter may shortly match the the previous match value thus cause test_valid_function_without_alarm run failed. Signed-off-by: Holt Sun <holt.sun@nxp.com>
1 parent bcec3bd commit fba7c3e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/counter/counter_mcux_lptmr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ static void mcux_lptmr_isr(const struct device *dev)
247247
uint32_t current_count = LPTMR_GetCurrentTimerCount(config->base);
248248

249249
LPTMR_StopTimer(config->base);
250+
LPTMR_SetTimerPeriod(config->base, config->info.max_top_value);
250251

251252
callback(dev, 0, current_count, user_data);
252253

0 commit comments

Comments
 (0)