}\r
else\r
{\r
- xTCB = ( TCB_t * ) xTask;\r
+ xTCB = xTask;\r
}\r
\r
/* Save the hook function in the TCB. A critical section is required as\r
/* If xTask is NULL then we are calling our own task hook. */\r
if( xTask == NULL )\r
{\r
- xTCB = ( TCB_t * ) pxCurrentTCB;\r
+ xTCB = pxCurrentTCB;\r
}\r
else\r
{\r
\r
if( xTask != NULL )\r
{\r
- pxTCB = ( TCB_t * ) xTask;\r
+ pxTCB = xTask;\r
uxReturn = pxTCB->uxTaskNumber;\r
}\r
else\r
\r
if( xTask != NULL )\r
{\r
- pxTCB = ( TCB_t * ) xTask;\r
+ pxTCB = xTask;\r
pxTCB->uxTaskNumber = uxHandle;\r
}\r
}\r
uint8_t ucOriginalNotifyState;\r
\r
configASSERT( xTaskToNotify );\r
- pxTCB = ( TCB_t * ) xTaskToNotify;\r
+ pxTCB = xTaskToNotify;\r
\r
taskENTER_CRITICAL();\r
{\r
http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
\r
- pxTCB = ( TCB_t * ) xTaskToNotify;\r
+ pxTCB = xTaskToNotify;\r
\r
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
\r
- pxTCB = ( TCB_t * ) xTaskToNotify;\r
+ pxTCB = xTaskToNotify;\r
\r
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
#error configUSE_TIMERS must be set to 1 to make the xTimerPendFunctionCall() function available.\r
#endif\r
\r
-/* Lint e961 and e750 are suppressed as a MISRA exception justified because the\r
-MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined for the\r
-header files above, but not in this file, in order to generate the correct\r
-privileged Vs unprivileged linkage and placement. */\r
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750. */\r
+/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified\r
+because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined\r
+for the header files above, but not in this file, in order to generate the\r
+correct privileged Vs unprivileged linkage and placement. */\r
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e9021 !e961 !e750. */\r
\r
\r
/* This entire source file will be skipped if the application is not configured\r
#endif\r
\r
/* The definition of the timers themselves. */\r
-typedef struct tmrTimerControl\r
+typedef struct TimerDef_t\r
{\r
const char *pcTimerName; /*<< Text name. This is not used by the kernel, it is included simply to make debugging easier. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
ListItem_t xTimerListItem; /*<< Standard linked list item as used by all kernel features for event management. */\r
/* The list in which active timers are stored. Timers are referenced in expire\r
time order, with the nearest expiry time at the front of the list. Only the\r
timer service task is allowed to access these lists. */\r
-PRIVILEGED_DATA static List_t xActiveTimerList1;\r
-PRIVILEGED_DATA static List_t xActiveTimerList2;\r
PRIVILEGED_DATA static List_t *pxCurrentTimerList;\r
PRIVILEGED_DATA static List_t *pxOverflowTimerList;\r
\r
{\r
Timer_t *pxNewTimer;\r
\r
- pxNewTimer = ( Timer_t * ) pvPortMalloc( sizeof( Timer_t ) );\r
+ pxNewTimer = ( Timer_t * ) pvPortMalloc( sizeof( Timer_t ) ); /*lint !e9087 !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack, and the first member of Timer_t is always a pointer to the timer's mame. */\r
\r
if( pxNewTimer != NULL )\r
{\r
structure. */\r
volatile size_t xSize = sizeof( StaticTimer_t );\r
configASSERT( xSize == sizeof( Timer_t ) );\r
+ ( void ) xSize; /* Keeps lint quiet when configASSERT() is not defined. */\r
}\r
#endif /* configASSERT_DEFINED */\r
\r
/* A pointer to a StaticTimer_t structure MUST be provided, use it. */\r
configASSERT( pxTimerBuffer );\r
- pxNewTimer = ( Timer_t * ) pxTimerBuffer; /*lint !e740 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */\r
+ pxNewTimer = ( Timer_t * ) pxTimerBuffer; /*lint !e740 !e9087 StaticTimer_t is a pointer to a Timer_t, so guaranteed to be aligned and sized correctly (checked by an assert()), so this is safe. */\r
\r
if( pxNewTimer != NULL )\r
{\r
/* Send a command to the timer service task to start the xTimer timer. */\r
xMessage.xMessageID = xCommandID;\r
xMessage.u.xTimerParameters.xMessageValue = xOptionalValue;\r
- xMessage.u.xTimerParameters.pxTimer = ( Timer_t * ) xTimer;\r
+ xMessage.u.xTimerParameters.pxTimer = xTimer;\r
\r
if( xCommandID < tmrFIRST_FROM_ISR_COMMAND )\r
{\r
\r
TickType_t xTimerGetPeriod( TimerHandle_t xTimer )\r
{\r
-Timer_t *pxTimer = ( Timer_t * ) xTimer;\r
+Timer_t *pxTimer = xTimer;\r
\r
configASSERT( xTimer );\r
return pxTimer->xTimerPeriodInTicks;\r
\r
TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer )\r
{\r
-Timer_t * pxTimer = ( Timer_t * ) xTimer;\r
+Timer_t * pxTimer = xTimer;\r
TickType_t xReturn;\r
\r
configASSERT( xTimer );\r
\r
const char * pcTimerGetName( TimerHandle_t xTimer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
{\r
-Timer_t *pxTimer = ( Timer_t * ) xTimer;\r
+Timer_t *pxTimer = xTimer;\r
\r
configASSERT( xTimer );\r
return pxTimer->pcTimerName;\r
static void prvProcessExpiredTimer( const TickType_t xNextExpireTime, const TickType_t xTimeNow )\r
{\r
BaseType_t xResult;\r
-Timer_t * const pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList );\r
+Timer_t * const pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList ); /*lint !e9087 !e9079 void * is used as this macro is used with tasks and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
\r
/* Remove the timer from the list of active timers. A check has already\r
been performed to ensure the list is not empty. */\r
xNextExpireTime = listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxCurrentTimerList );\r
\r
/* Remove the timer from the list. */\r
- pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList );\r
+ pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList ); /*lint !e9087 !e9079 void * is used as this macro is used with tasks and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
( void ) uxListRemove( &( pxTimer->xTimerListItem ) );\r
traceTIMER_EXPIRED( pxTimer );\r
\r
\r
static void prvCheckForValidListAndQueue( void )\r
{\r
+PRIVILEGED_DATA static List_t xActiveTimerList1;\r
+PRIVILEGED_DATA static List_t xActiveTimerList2;\r
+\r
/* Check that the list from which active timers are referenced, and the\r
queue used to communicate with the timer service, have been\r
initialised. */\r
BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer )\r
{\r
BaseType_t xTimerIsInActiveList;\r
-Timer_t *pxTimer = ( Timer_t * ) xTimer;\r
+Timer_t *pxTimer = xTimer;\r
\r
configASSERT( xTimer );\r
\r
/* Checking to see if it is in the NULL list in effect checks to see if\r
it is referenced from either the current or the overflow timer lists in\r
one go, but the logic has to be reversed, hence the '!'. */\r
- xTimerIsInActiveList = ( BaseType_t ) !( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) ); /*lint !e961. Cast is only redundant when NULL is passed into the macro. */\r
+ if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdTRUE )\r
+ {\r
+ xTimerIsInActiveList = pdFALSE;\r
+ }\r
+ else\r
+ {\r
+ xTimerIsInActiveList = pdTRUE;\r
+ }\r
}\r
taskEXIT_CRITICAL();\r
\r
\r
void *pvTimerGetTimerID( const TimerHandle_t xTimer )\r
{\r
-Timer_t * const pxTimer = ( Timer_t * ) xTimer;\r
+Timer_t * const pxTimer = xTimer;\r
void *pvReturn;\r
\r
configASSERT( xTimer );\r
\r
void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID )\r
{\r
-Timer_t * const pxTimer = ( Timer_t * ) xTimer;\r
+Timer_t * const pxTimer = xTimer;\r
\r
configASSERT( xTimer );\r
\r