yangsong8-a1 opened a new pull request, #21920:
URL: https://github.com/apache/nuttx/pull/21920
## Summary
The arch timer callback (CONFIG_SCHED_TICKLESS +
CONFIG_TIMER_ARCH) exchanges microseconds with the timer lower half
(struct timer_status_s and the tccb_t next_interval argument are in
microseconds), while the scheduler side (g_timer.timebase, the value
stored through g_timer.next_interval) works in ticks. The callback
added the raw microsecond interval to the tick-based timebase and
wrote the raw tick interval back into the microsecond-based
next_interval, so the system time drifted and the programmed interval
was wrong whenever USEC_PER_TICK != 1.
Convert at the boundary with USEC2TICK() / TICK2USEC(); the systick
lower half keeps exchanging microseconds.
## Impact
drivers/timers/arch_timer.c only, active with CONFIG_TIMER_ARCH
(boards wiring it: ARMv7-M/V8-M systick users such as rtl8721f, at32,
gd32f4, nrf91, ra8m1). No API change.
Not tested at runtime: no QEMU-capable board registers a timer lower
half through up_timer_set_lowerhalf(); the change is verified by
build and code inspection only.
## Testing
Ubuntu 22.04, aarch64-none-elf-gcc 13.2. Builds with no new
warnings:
- qemu-armv8a:nsh + CONFIG_TIMER + CONFIG_TIMER_ARCH +
CONFIG_SCHED_TICKLESS (compiles drivers/timers/arch_timer.c)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]