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

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

commit bbb4cc4f6f286667f553575d59ad085713ccc71b
Author: ouyangxiangzhen <[email protected]>
AuthorDate: Tue Jul 29 19:30:07 2025 +0800

    timers/arch_alarm: Replace relative oneshot API.
    
    This commit replaced the relative oneshot API with the absolute API.
    
    Signed-off-by: ouyangxiangzhen <[email protected]>
---
 drivers/timers/arch_alarm.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/timers/arch_alarm.c b/drivers/timers/arch_alarm.c
index 09adbdb45da..2d1a32a1da1 100644
--- a/drivers/timers/arch_alarm.c
+++ b/drivers/timers/arch_alarm.c
@@ -262,17 +262,7 @@ int weak_function up_alarm_tick_start(clock_t ticks)
 
   if (g_oneshot_lower != NULL)
     {
-      clock_t now = 0;
-      clock_t delta;
-
-      ONESHOT_TICK_CURRENT(g_oneshot_lower, &now);
-      delta = ticks - now;
-      if ((sclock_t)delta < 0)
-        {
-          delta = 0;
-        }
-
-      ret = ONESHOT_TICK_START(g_oneshot_lower, delta);
+      ret = ONESHOT_TICK_ABSOLUTE(g_oneshot_lower, ticks);
     }
 
   return ret;

Reply via email to