Is it an error to call xTimerStop() on an xTimer that is not running?

The documentation for xTimerStop() states:

xTimerStop() stops a timer that was previously started using either of the xTimerStart(), xTimerReset(), xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and xTimerChangePeriodFromISR() API functions.

However, it does not state what happens if you call xTimerStop() on an xTimer that is stopped. Is doing so considered an error?

No, it’s not considered an error to call xTimerStop() on a timer that is already stopped.

1 Like