void vPortSetupTimerInterrupt( void )\r
{\r
/* Calculate the constants required to configure the tick interrupt. */\r
- #if configUSE_TICKLESS_IDLE == 1\r
+ #if( configUSE_TICKLESS_IDLE == 1 )\r
{\r
ulTimerCountsForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ );\r
xMaximumPossibleSuppressedTicks = portMAX_24_BIT_NUMBER / ulTimerCountsForOneTick;\r
{\r
/* The queue was full and a block time was specified so\r
configure the timeout structure. */\r
- vTaskSetTimeOutState( &xTimeOut );\r
+ vTaskInternalSetTimeOutState( &xTimeOut );\r
xEntryTimeSet = pdTRUE;\r
}\r
else\r
{\r
/* The queue was empty and a block time was specified so\r
configure the timeout structure. */\r
- vTaskSetTimeOutState( &xTimeOut );\r
+ vTaskInternalSetTimeOutState( &xTimeOut );\r
xEntryTimeSet = pdTRUE;\r
}\r
else\r
/* For inheritance to have occurred there must have been an\r
initial timeout, and an adjusted timeout cannot become 0, as\r
if it were 0 the function would have exited. */\r
- configASSERT( xInheritanceOccurred == pdFALSE );\r
+ #if( configUSE_MUTEXES == 1 )\r
+ {\r
+ configASSERT( xInheritanceOccurred == pdFALSE );\r
+ }\r
+ #endif /* configUSE_MUTEXES */\r
\r
/* The semaphore count was 0 and no block time is specified\r
(or the block time has expired) so exit now. */\r
{\r
/* The semaphore count was 0 and a block time was specified\r
so configure the timeout structure ready to block. */\r
- vTaskSetTimeOutState( &xTimeOut );\r
+ vTaskInternalSetTimeOutState( &xTimeOut );\r
xEntryTimeSet = pdTRUE;\r
}\r
else\r
/* The queue was empty and a block time was specified so\r
configure the timeout structure ready to enter the blocked\r
state. */\r
- vTaskSetTimeOutState( &xTimeOut );\r
+ vTaskInternalSetTimeOutState( &xTimeOut );\r
xEntryTimeSet = pdTRUE;\r
}\r
else\r
void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut )\r
{\r
configASSERT( pxTimeOut );\r
+ taskENTER_CRITICAL();\r
+ {\r
+ pxTimeOut->xOverflowCount = xNumOfOverflows;\r
+ pxTimeOut->xTimeOnEntering = xTickCount;\r
+ }\r
+ taskEXIT_CRITICAL();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut )\r
+{\r
+ /* For internal use only as it does not use a critical section. */\r
pxTimeOut->xOverflowCount = xNumOfOverflows;\r
pxTimeOut->xTimeOnEntering = xTickCount;\r
}\r
{\r
/* Not a genuine timeout. Adjust parameters for time remaining. */\r
*pxTicksToWait -= xElapsedTime;\r
- vTaskSetTimeOutState( pxTimeOut );\r
+ vTaskInternalSetTimeOutState( pxTimeOut );\r
xReturn = pdFALSE;\r
}\r
else\r