From 840c4fceefb459191bf26a356fa3ff8d6c5aeda8 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 20 Jan 2026 10:48:28 +0800 Subject: [PATCH] ostest/hrtimer: align hrtimer callback declaration align hrtimer callback declaration with latest update of hrtimer Signed-off-by: Chengdong Wang --- testing/ostest/hrtimer.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/testing/ostest/hrtimer.c b/testing/ostest/hrtimer.c index 3943140e6..1094167ac 100644 --- a/testing/ostest/hrtimer.c +++ b/testing/ostest/hrtimer.c @@ -128,7 +128,7 @@ static void hrtimer_test_init(FAR struct hrtimer_test_s *hrtimer_test, ****************************************************************************/ static uint64_t -test_hrtimer_callback(FAR hrtimer_t *hrtimer, uint64_t expired) +test_hrtimer_callback(FAR const hrtimer_t *hrtimer, uint64_t expired) { struct timespec ts; uint32_t diff; @@ -167,15 +167,15 @@ test_hrtimer_callback(FAR hrtimer_t *hrtimer, uint64_t expired) /* Stop the test after 15 expirations */ - if (test->count >= 15) + if (test->count < 15) { - ret = hrtimer_cancel(hrtimer); - HRTIMER_TEST(ret, 0); - - test->active = false; + return test->period; + } + else + { + test->active = false; + return 0; } - - return test->period; } /****************************************************************************