Fix-Point commented on code in PR #18131:
URL: https://github.com/apache/nuttx/pull/18131#discussion_r2726272341
##########
sched/hrtimer/hrtimer_process.c:
##########
@@ -122,22 +119,18 @@ void hrtimer_process(uint64_t now)
flags = spin_lock_irqsave(&g_hrtimer_spinlock);
-#ifdef CONFIG_SMP
- g_hrtimer_running[cpu] = NULL;
-#endif
-
/* If the timer is periodic and has not been rearmed or
* cancelled concurrently,
* compute next expiration and reinsert into RB-tree
*/
- if (period > 0 && hrtimer->expired == expired)
+ if (period != 0u && hrtimer_is_running(hrtimer, cpu))
{
hrtimer->expired += period;
/* Ensure no overflow occurs */
- DEBUGASSERT(hrtimer->expired > period);
+ DEBUGASSERT(hrtimer->expired >= period);
Review Comment:
If `expired == 0`, `period == 10ms`, then `expired + period = 10ms` will not
satisfy `expired + period > period`.
--
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]