From: richardbarry Date: Sat, 12 Feb 2011 13:53:25 +0000 (+0000) Subject: Add ISR safe timer API. X-Git-Tag: V7.0.0~56 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=01d5d79602fbe9fbbc38841cd2c687917d8c6d8f;p=freertos Add ISR safe timer API. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1293 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/include/timers.h b/Source/include/timers.h index e735140a8..95431e464 100644 --- a/Source/include/timers.h +++ b/Source/include/timers.h @@ -85,14 +85,19 @@ typedef void (*tmrTIMER_CALLBACK)( xTimerHandle xTimer ); portBASE_TYPE xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION; xTimerHandle xTimerCreate( const signed char *pcTimerName, portTickType xTimerPeriod, unsigned portBASE_TYPE uxAutoReload, void * pvTimerID, tmrTIMER_CALLBACK pxCallbackFunction ) PRIVILEGED_FUNCTION; void *pvTimerGetTimerID( xTimerHandle xTimer ) PRIVILEGED_FUNCTION; -portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, portTickType xBlockTime ) PRIVILEGED_FUNCTION; +portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, portBASE_TYPE *pxHigherPriorityTaskWoken, portTickType xBlockTime ) PRIVILEGED_FUNCTION; portBASE_TYPE xTimerIsTimerActive( xTimerHandle xTimer ) PRIVILEGED_FUNCTION; -#define xTimerStart( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, 0, xBlockTime ) -#define xTimerStop( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_STOP, 0, xBlockTime ) -#define xTimerChangePeriod( xTimer, xNewPeriod, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_CHANGE_PERIOD, xNewPeriod, xBlockTime ) -#define xTimerDelete( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_DELETE, 0, xBlockTime ) -#define xTimerReset( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, 0, xBlockTime ) +#define xTimerStart( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, 0, NULL, xBlockTime ) +#define xTimerStop( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_STOP, 0, NULL, xBlockTime ) +#define xTimerChangePeriod( xTimer, xNewPeriod, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_CHANGE_PERIOD, xNewPeriod, NULL, xBlockTime ) +#define xTimerDelete( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_DELETE, 0, NULL, xBlockTime ) +#define xTimerReset( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, 0, NULL, xBlockTime ) + +#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, 0, pxHigherPriorityTaskWoken, 0 ) +#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( xTimer, tmrCOMMAND_STOP, 0, pxHigherPriorityTaskWoken, 0 ) +#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) xTimerGenericCommand( xTimer, tmrCOMMAND_CHANGE_PERIOD, xNewPeriod, pxHigherPriorityTaskWoken, 0 ) +#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, 0, pxHigherPriorityTaskWoken, 0 ) #ifdef __cplusplus }