Function esp_idf_svc::hal::sys::xTimerIsTimerActive

source ·
pub unsafe extern "C" fn xTimerIsTimerActive(
    xTimer: *mut tmrTimerControl,
) -> i32
Expand description

Queries a timer to see if it is active or dormant.

A timer will be dormant if: 1) It has been created but not started, or 2) It is an expired one-shot timer that has not been restarted.

Timers are created in the dormant state. The xTimerStart(), xTimerReset(), xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and xTimerChangePeriodFromISR() API functions can all be used to transition a timer into the active state.

@param xTimer The timer being queried.

@return pdFALSE will be returned if the timer is dormant. A value other than pdFALSE will be returned if the timer is active.

Example usage: @verbatim // This function assumes xTimer has already been created. void vAFunction( TimerHandle_t xTimer ) { if( xTimerIsTimerActive( xTimer ) != pdFALSE ) // or more simply and equivalently “if( xTimerIsTimerActive( xTimer ) )” { // xTimer is active, do something. } else { // xTimer is not active, do something else. } } @endverbatim