This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new bf9a48a4b68 drivers/timers: fix tickless arch timer unit conversion
bf9a48a4b68 is described below

commit bf9a48a4b6863fff0f727a753f6cdbac76f1959b
Author: buxiasen <[email protected]>
AuthorDate: Tue Mar 24 17:12:19 2026 +0800

    drivers/timers: fix tickless arch timer unit conversion
    
    Keep the arch timer callback in tick units while the systick
    lower-half continues to exchange microseconds.
    
    Signed-off-by: buxiasen <[email protected]>
---
 drivers/timers/arch_timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/timers/arch_timer.c b/drivers/timers/arch_timer.c
index 31d5df2fd67..e5c82e5dfec 100644
--- a/drivers/timers/arch_timer.c
+++ b/drivers/timers/arch_timer.c
@@ -205,7 +205,7 @@ static bool timer_callback(FAR uint32_t *next_interval, FAR 
void *arg)
   struct timer_status_s status;
   uint32_t temp_interval;
 
-  g_timer.timebase     += *next_interval;
+  g_timer.timebase     += USEC2TICK(*next_interval);
   temp_interval         = g_oneshot_maxticks;
   g_timer.next_interval = &temp_interval;
   nxsched_process_timer();
@@ -215,7 +215,7 @@ static bool timer_callback(FAR uint32_t *next_interval, FAR 
void *arg)
   if (temp_interval != status.timeleft)
     {
       g_timer.timebase += status.timeout - status.timeleft;
-      *next_interval = temp_interval;
+      *next_interval = TICK2USEC(temp_interval);
     }
 #else
   g_timer.timebase++;

Reply via email to