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 48e5e989a362b53f98f12c7e9533da28c21b2050 Author: ouyangxiangzhen <[email protected]> AuthorDate: Wed Oct 28 20:38:38 2026 +0800 sched/hrtimer: Make hrtimer_gettime() take a const timer pointer hrtimer_gettime() only queries the timer and never modifies it. Mark the parameter const to document that and allow callers holding const pointers to query a timer. Assisted-by: mimo-v2.6-pro Signed-off-by: ouyangxiangzhen <[email protected]> --- include/nuttx/hrtimer.h | 2 +- sched/hrtimer/hrtimer_gettime.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nuttx/hrtimer.h b/include/nuttx/hrtimer.h index 8afd6806cec..2a54bfb96d5 100644 --- a/include/nuttx/hrtimer.h +++ b/include/nuttx/hrtimer.h @@ -240,7 +240,7 @@ int hrtimer_start(FAR hrtimer_t *hrtimer, hrtimer_entry_t func, * ****************************************************************************/ -uint64_t hrtimer_gettime(FAR hrtimer_t *timer); +uint64_t hrtimer_gettime(FAR const hrtimer_t *timer); #ifdef __cplusplus } diff --git a/sched/hrtimer/hrtimer_gettime.c b/sched/hrtimer/hrtimer_gettime.c index 17376a58dfb..c3f3c8d33e8 100644 --- a/sched/hrtimer/hrtimer_gettime.c +++ b/sched/hrtimer/hrtimer_gettime.c @@ -49,7 +49,7 @@ * ****************************************************************************/ -uint64_t hrtimer_gettime(FAR hrtimer_t *timer) +uint64_t hrtimer_gettime(FAR const hrtimer_t *timer) { int64_t remain = hrtimer_read_64(&timer->expired) - clock_systime_nsec();
