FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest information, \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest information,\r
license and contact details.\r
- \r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
before vTaskStartScheduler() has been called?).\r
See http://www.freertos.org/FAQHelp.html for more tips.\r
**********************************************************************/\r
- \r
+\r
for( pxIterator = ( xListItem * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext )\r
{\r
/* There is nothing to do here, we are just iterating to the\r
\r
pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;\r
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;\r
- \r
+\r
/* The list item knows which list it is in. Obtain the list from the list\r
item. */\r
pxList = ( xList * ) pxItemToRemove->pvContainer;\r
\r
pxItemToRemove->pvContainer = NULL;\r
( pxList->uxNumberOfItems )--;\r
- \r
+\r
return pxList->uxNumberOfItems;\r
}\r
/*-----------------------------------------------------------*/\r
FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest information, \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest information,\r
license and contact details.\r
- \r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
\r
volatile signed portBASE_TYPE xRxLock; /*< Stores the number of items received from the queue (removed from the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */\r
volatile signed portBASE_TYPE xTxLock; /*< Stores the number of items transmitted to the queue (added to the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */\r
- \r
+\r
#if ( configUSE_TRACE_FACILITY == 1 )\r
unsigned char ucQueueNumber;\r
unsigned char ucQueueType;\r
\r
if( xNewQueue == pdFALSE )\r
{\r
- /* If there are tasks blocked waiting to read from the queue, then \r
- the tasks will remain blocked as after this function exits the queue \r
- will still be empty. If there are tasks blocked waiting to write to \r
- the queue, then one should be unblocked as after this function exits \r
+ /* If there are tasks blocked waiting to read from the queue, then\r
+ the tasks will remain blocked as after this function exits the queue\r
+ will still be empty. If there are tasks blocked waiting to write to\r
+ the queue, then one should be unblocked as after this function exits\r
it will be possible to write to it. */\r
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE )\r
{\r
{\r
/* Ensure the event queues start in the correct state. */\r
vListInitialise( &( pxQueue->xTasksWaitingToSend ) );\r
- vListInitialise( &( pxQueue->xTasksWaitingToReceive ) ); \r
+ vListInitialise( &( pxQueue->xTasksWaitingToReceive ) );\r
}\r
}\r
taskEXIT_CRITICAL();\r
/* This function is called by xSemaphoreGetMutexHolder(), and should not\r
be called directly. Note: This is is a good way of determining if the\r
calling task is the mutex holder, but not a good way of determining the\r
- identity of the mutex holder, as the holder may change between the \r
+ identity of the mutex holder, as the holder may change between the\r
following critical section exiting and the function returning. */\r
taskENTER_CRITICAL();\r
{\r
}\r
}\r
taskEXIT_CRITICAL();\r
- \r
+\r
return pxReturn;\r
}\r
\r
FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest information, \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest information,\r
license and contact details.\r
- \r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
PRIVILEGED_DATA static xQueueHandle xTimerQueue = NULL;\r
\r
#if ( INCLUDE_xTimerGetTimerDaemonTaskHandle == 1 )\r
- \r
+\r
PRIVILEGED_DATA static xTaskHandle xTimerTaskHandle = NULL;\r
- \r
+\r
#endif\r
\r
/*-----------------------------------------------------------*/\r
{\r
/* Create the timer task, storing its handle in xTimerTaskHandle so\r
it can be returned by the xTimerGetTimerDaemonTaskHandle() function. */\r
- xReturn = xTaskCreate( prvTimerTask, ( const signed char * ) "Tmr Svc", ( unsigned short ) configTIMER_TASK_STACK_DEPTH, NULL, ( ( unsigned portBASE_TYPE ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, &xTimerTaskHandle ); \r
+ xReturn = xTaskCreate( prvTimerTask, ( const signed char * ) "Tmr Svc", ( unsigned short ) configTIMER_TASK_STACK_DEPTH, NULL, ( ( unsigned portBASE_TYPE ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, &xTimerTaskHandle );\r
}\r
#else\r
{\r
/* Ensure the infrastructure used by the timer service task has been\r
created/initialised. */\r
prvCheckForValidListAndQueue();\r
- \r
+\r
/* Initialise the timer structure members using the function parameters. */\r
pxNewTimer->pcTimerName = pcTimerName;\r
pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;\r
pxNewTimer->pvTimerID = pvTimerID;\r
pxNewTimer->pxCallbackFunction = pxCallbackFunction;\r
vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );\r
- \r
+\r
traceTIMER_CREATE( pxNewTimer );\r
}\r
else\r
traceTIMER_CREATE_FAILED();\r
}\r
}\r
- \r
+\r
return ( xTimerHandle ) pxNewTimer;\r
}\r
/*-----------------------------------------------------------*/\r
{\r
xReturn = xQueueSendToBackFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );\r
}\r
- \r
+\r
traceTIMER_COMMAND_SEND( xTimer, xCommandID, xOptionalValue, xReturn );\r
}\r
- \r
+\r
return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
configASSERT( ( xTimerTaskHandle != NULL ) );\r
return xTimerTaskHandle;\r
}\r
- \r
+\r
#endif\r
/*-----------------------------------------------------------*/\r
\r
/* If a timer has expired, process it. Otherwise, block this task\r
until either a timer does expire, or a command is received. */\r
prvProcessTimerOrBlockTask( xNextExpireTime, xListWasEmpty );\r
- \r
+\r
/* Empty the command queue. */\r
- prvProcessReceivedCommands(); \r
+ prvProcessReceivedCommands();\r
}\r
}\r
/*-----------------------------------------------------------*/\r
PRIVILEGED_DATA static portTickType xLastTime = ( portTickType ) 0U;\r
\r
xTimeNow = xTaskGetTickCount();\r
- \r
+\r
if( xTimeNow < xLastTime )\r
{\r
prvSwitchTimerLists( xLastTime );\r
{\r
*pxTimerListsWereSwitched = pdFALSE;\r
}\r
- \r
+\r
xLastTime = xTimeNow;\r
- \r
+\r
return xTimeNow;\r
}\r
/*-----------------------------------------------------------*/\r
\r
listSET_LIST_ITEM_VALUE( &( pxTimer->xTimerListItem ), xNextExpiryTime );\r
listSET_LIST_ITEM_OWNER( &( pxTimer->xTimerListItem ), pxTimer );\r
- \r
+\r
if( xNextExpiryTime <= xTimeNow )\r
{\r
/* Has the expiry time elapsed between the command to start/reset a\r
}\r
\r
traceTIMER_COMMAND_RECEIVED( pxTimer, xMessage.xMessageID, xMessage.xMessageValue );\r
- \r
+\r
switch( xMessage.xMessageID )\r
{\r
- case tmrCOMMAND_START : \r
+ case tmrCOMMAND_START :\r
/* Start or restart a timer. */\r
if( prvInsertTimerInActiveList( pxTimer, xMessage.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.xMessageValue ) == pdTRUE )\r
{\r
}\r
break;\r
\r
- case tmrCOMMAND_STOP : \r
+ case tmrCOMMAND_STOP :\r
/* The timer has already been removed from the active list.\r
There is nothing to do here. */\r
break;\r
vPortFree( pxTimer );\r
break;\r
\r
- default : \r
+ default :\r
/* Don't expect to get here. */\r
break;\r
}\r
\r
/* Remove compiler warnings if configASSERT() is not defined. */\r
( void ) xLastTime;\r
- \r
+\r
/* The tick count has overflowed. The timer lists must be switched.\r
If there are any timers still referenced from the current timer list\r
then they must have expired and should be processed before the lists\r