Latest: FreeRTOS V7.1.1 was released May 1, 2012. View the change history.
Free RTOS logo
FreeRTOS royalty free RTOS RSS feed  Real time embedded FreeRTOS mailing list  
Quick Start Supported MCUs Books & Kits Ecosystem Contact & Support



Last site update May 11 2012

 

nabto

FreeRTOS Connect

xTimerIsTimerActive
[Timer API]

timers.h
 portBASE_TYPE xTimerIsTimerActive( xTimerHandle xTimer );

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 on-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.

Parameters:
xTimer   The timer being queried.
Returns:
pdFALSE will be returned if the timer is dormant. A value other than pdFALSE will be returned if the timer is active.
Example usage:
 /* This function assumes xTimer has already been created. */
 void vAFunction( xTimerHandle xTimer )
 {
     /* or more simply and equivalently "if( xTimerIsTimerActive( xTimer ) )" */
     if( xTimerIsTimerActive( xTimer ) != pdFALSE ) 
     {
         /* xTimer is active, do something. */
     }
     else
     {
         /* xTimer is not active, do something else. */
     } 
 }






[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2012 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.