\r
/**\r
* xTimerHandle xTimerCreate( const signed char *pcTimerName,\r
- * portTickType xTimerPeriod,\r
+ * portTickType xTimerPeriodInTicks,\r
* unsigned portBASE_TYPE uxAutoReload,\r
* void * pvTimerID,\r
* tmrTIMER_CALLBACK pxCallbackFunction );\r
* purely to assist debugging. The kernel itself only ever references a timer by\r
* its handle, and never by its name.\r
*\r
- * @param xTimerPeriod The timer period. The time is defined in tick periods so\r
+ * @param xTimerPeriodInTicks The timer period. The time is defined in tick periods so\r
* the constant portTICK_RATE_MS can be used to convert a time that has been\r
* specified in milliseconds. For example, if the timer must expire after 100\r
- * ticks, then xTimerPeriod should be set to 100. Alternatively, if the timer\r
+ * ticks, then xTimerPeriodInTicks should be set to 100. Alternatively, if the timer\r
* must expire after 500ms, then xPeriod can be set to ( 500 / portTICK_RATE_MS )\r
* provided configTICK_RATE_HZ is less than or equal to 1000.\r
*\r
* @param uxAutoReload If uxAutoReload is set to pdTRUE then the timer will\r
- * expire repeatedly with a frequency set by the xTimerPeriod parameter. If\r
+ * expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter. If\r
* uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and\r
* enter the dormant state after it expires.\r
*\r
*\r
* Example usage:\r
*\r
- *\r
* #define NUM_TIMERS 5\r
*\r
* // An array to hold handles to the created timers.\r
* for use by the kernel only.\r
*/\r
portBASE_TYPE xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;\r
-portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, portBASE_TYPE *pxHigherPriorityTaskWoken, portTickType xBlockTime ) PRIVILEGED_FUNCTION;\r
+portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portTickType xBlockTime ) PRIVILEGED_FUNCTION;\r
\r
#ifdef __cplusplus\r
}\r
{\r
portBASE_TYPE xYieldRequired = pdFALSE;\r
tskTCB *pxTCB;\r
+ unsigned portBASE_TYPE uxSavedInterruptStatus;\r
\r
configASSERT( pxTaskToResume );\r
\r
pxTCB = ( tskTCB * ) pxTaskToResume;\r
\r
- if( xTaskIsTaskSuspended( pxTCB ) == pdTRUE )\r
+ uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
- traceTASK_RESUME_FROM_ISR( pxTCB );\r
-\r
- if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )\r
+ if( xTaskIsTaskSuspended( pxTCB ) == pdTRUE )\r
{\r
- xYieldRequired = ( pxTCB->uxPriority >= pxCurrentTCB->uxPriority );\r
- vListRemove( &( pxTCB->xGenericListItem ) );\r
- prvAddTaskToReadyQueue( pxTCB );\r
- }\r
- else\r
- {\r
- /* We cannot access the delayed or ready lists, so will hold this\r
- task pending until the scheduler is resumed, at which point a\r
- yield will be performed if necessary. */\r
- vListInsertEnd( ( xList * ) &( xPendingReadyList ), &( pxTCB->xEventListItem ) );\r
+ traceTASK_RESUME_FROM_ISR( pxTCB );\r
+\r
+ if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )\r
+ {\r
+ xYieldRequired = ( pxTCB->uxPriority >= pxCurrentTCB->uxPriority );\r
+ vListRemove( &( pxTCB->xGenericListItem ) );\r
+ prvAddTaskToReadyQueue( pxTCB );\r
+ }\r
+ else\r
+ {\r
+ /* We cannot access the delayed or ready lists, so will hold this\r
+ task pending until the scheduler is resumed, at which point a\r
+ yield will be performed if necessary. */\r
+ vListInsertEnd( ( xList * ) &( xPendingReadyList ), &( pxTCB->xEventListItem ) );\r
+ }\r
}\r
}\r
+ portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );\r
\r
return xYieldRequired;\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, portBASE_TYPE *pxHigherPriorityTaskWoken, portTickType xBlockTime )\r
+portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portTickType xBlockTime )\r
{\r
portBASE_TYPE xReturn = pdFAIL;\r
xTIMER_MESSAGE xMessage;\r