BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;\r
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;\r
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;\r
+UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;\r
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;\r
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;\r
BaseType_t MPU_xTimerCreateTimerTask( void ) FREERTOS_SYSTEM_CALL;\r
#define xTimerPendFunctionCall MPU_xTimerPendFunctionCall\r
#define pcTimerGetName MPU_pcTimerGetName\r
#define vTimerSetReloadMode MPU_vTimerSetReloadMode\r
+ #define uxTimerGetReloadMode MPU_uxTimerGetReloadMode\r
#define xTimerGetPeriod MPU_xTimerGetPeriod\r
#define xTimerGetExpiryTime MPU_xTimerGetExpiryTime\r
#define xTimerGenericCommand MPU_xTimerGenericCommand\r
/**\r
* void vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload );\r
*\r
- * Updates a timer to be either an autoreload timer, in which case the timer\r
+ * Updates a timer to be either an auto-reload timer, in which case the timer\r
* automatically resets itself each time it expires, or a one shot timer, in\r
* which case the timer will only expire once unless it is manually restarted.\r
*\r
*/\r
void vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload ) PRIVILEGED_FUNCTION;\r
\r
+/**\r
+* UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer );\r
+*\r
+* Queries a timer to determine if it is an auto-reload timer, in which case the timer\r
+* automatically resets itself each time it expires, or a one shot timer, in\r
+* which case the timer will only expire once unless it is manually restarted.\r
+*\r
+* @param xTimer The handle of the timer being queried.\r
+*\r
+* @return If the timer is an auto-reload timer then pdTRUE is returned, otherwise\r
+* pdFALSE is returned.\r
+*/\r
+UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;\r
+\r
/**\r
* TickType_t xTimerGetPeriod( TimerHandle_t xTimer );\r
*\r
#endif\r
/*-----------------------------------------------------------*/\r
\r
+#if( configUSE_TIMERS == 1 )\r
+ UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer )\r
+ {\r
+ BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+ UBaseType_t uxReturn;\r
+\r
+ uxReturn = uxTimerGetReloadMode( xTimer );\r
+ vPortResetPrivilege( xRunningPrivileged );\r
+ return uxReturn;\r
+ }\r
+#endif\r
+/*-----------------------------------------------------------*/\r
+\r
#if( configUSE_TIMERS == 1 )\r
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) /* FREERTOS_SYSTEM_CALL */\r
{\r
if( xIndex < configNUM_THREAD_LOCAL_STORAGE_POINTERS )\r
{\r
pxTCB = prvGetTCBFromHandle( xTaskToSet );\r
+ configASSERT( pxTCB != NULL );\r
pxTCB->pvThreadLocalStoragePointers[ xIndex ] = pvValue;\r
}\r
}\r
\r
/*\r
* An active timer has reached its expire time. Reload the timer if it is an\r
- * auto reload timer, then call its callback.\r
+ * auto-reload timer, then call its callback.\r
*/\r
static void prvProcessExpiredTimer( const TickType_t xNextExpireTime, const TickType_t xTimeNow ) PRIVILEGED_FUNCTION;\r
\r
if( pxNewTimer != NULL )\r
{\r
/* Status is thus far zero as the timer is not created statically\r
- and has not been started. The autoreload bit may get set in\r
+ and has not been started. The auto-reload bit may get set in\r
prvInitialiseNewTimer. */\r
pxNewTimer->ucStatus = 0x00;\r
prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer );\r
{\r
/* Timers can be created statically or dynamically so note this\r
timer was created statically in case it is later deleted. The\r
- autoreload bit may get set in prvInitialiseNewTimer(). */\r
+ auto-reload bit may get set in prvInitialiseNewTimer(). */\r
pxNewTimer->ucStatus = tmrSTATUS_IS_STATICALLY_ALLOCATED;\r
\r
prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer );\r
}\r
/*-----------------------------------------------------------*/\r
\r
+UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer )\r
+{\r
+Timer_t * pxTimer = xTimer;\r
+UBaseType_t uxReturn;\r
+\r
+ configASSERT( xTimer );\r
+ taskENTER_CRITICAL();\r
+ {\r
+ if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) == 0 )\r
+ {\r
+ /* Not an auto-reload timer. */\r
+ uxReturn = ( UBaseType_t ) pdFALSE;\r
+ }\r
+ else\r
+ {\r
+ /* Is an auto-reload timer. */\r
+ uxReturn = ( UBaseType_t ) pdTRUE;\r
+ }\r
+ }\r
+ taskEXIT_CRITICAL();\r
+\r
+ return uxReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer )\r
{\r
Timer_t * pxTimer = xTimer;\r
( void ) uxListRemove( &( pxTimer->xTimerListItem ) );\r
traceTIMER_EXPIRED( pxTimer );\r
\r
- /* If the timer is an auto reload timer then calculate the next\r
+ /* If the timer is an auto-reload timer then calculate the next\r
expiry time and re-insert the timer in the list of active timers. */\r
if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0 )\r
{\r