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
commit 77f09d90bab81348a369d1da08f41d499b7d386d Author: buxiasen <[email protected]> AuthorDate: Thu Feb 12 12:49:46 2026 +0800 drivers/arch_timer: fix up_timer_cancel no weak implement Cause if enable systick and no default implement link error. Signed-off-by: buxiasen <[email protected]> --- drivers/timers/arch_timer.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/timers/arch_timer.c b/drivers/timers/arch_timer.c index b8689863680..2cfef37cdae 100644 --- a/drivers/timers/arch_timer.c +++ b/drivers/timers/arch_timer.c @@ -365,6 +365,26 @@ int weak_function up_timer_tick_cancel(FAR clock_t *ticks) return ret; } + +int weak_function up_timer_cancel(FAR struct timespec *ts) +{ + int ret = -EAGAIN; + + if (g_timer.lower != NULL) + { + clock_t ticks = update_timeout(g_oneshot_maxticks); + + if (ts) + { + ts->tv_sec = ticks / TICK_PER_SEC; + ts->tv_nsec = (ticks % TICK_PER_SEC) * NSEC_PER_TICK; + } + + ret = OK; + } + + return ret; +} #endif /****************************************************************************
