wangchdo commented on code in PR #17784:
URL: https://github.com/apache/nuttx/pull/17784#discussion_r2667363916
##########
sched/hrtimer/hrtimer_cancel.c:
##########
@@ -129,11 +129,13 @@ int hrtimer_cancel(FAR hrtimer_t *hrtimer)
if (hrtimer_is_armed(hrtimer))
{
hrtimer_remove(hrtimer);
- }
- /* Mark timer as cancelled */
+ /* Mark timer as cancelled */
+
+ hrtimer->func = NULL;
+ }
- hrtimer->expired = UINT64_MAX;
+ hrtimer->expired++;
Review Comment:
> > Byt the way, a 64-bit hardware timer cannot overflow during lifetime of
any equipment.
>
> `hrtimer_start_absolute(UINT64_MAX, period_func)` can not be cancelled
properly.
But why do we need `hrtimer_start_absolute(UINT64_MAX, period_func)` ?
Event we need this, I think we can add a DEBUGASSERT in the code is better.
--
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]