}\r
\r
#endif\r
- /*-----------------------------------------------------------*/\r
+/*-----------------------------------------------------------*/\r
\r
#if configQUEUE_REGISTRY_SIZE > 0\r
\r
}\r
\r
#endif\r
+/*-----------------------------------------------------------*/\r
+\r
+#if configUSE_TIMERS == 1\r
+\r
+ void vQueueWaitForMessageRestricted( xQueueHandle pxQueue, portTickType xTicksToWait )\r
+ {\r
+ /* This function should not be called by application code hence the \r
+ 'Restricted' in its name. It is not part of the public API. It is designed\r
+ for use by kernel code, and has special calling requirements - it should be\r
+ called from a critical section, and then a yield performed after it is\r
+ called. Also, the call tree makes use of vListInsert() which should normally\r
+ not be called from a critical section - so an assumption is made that the list\r
+ being inserted into is empty and therefore the insertion will be fast. */\r
+\r
+ /* Only do anything if there are no message in the queue. */\r
+ if( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0U )\r
+ {\r
+ /* There is nothing in the queue, block for the specified period. */\r
+ vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait );\r
+ }\r
+ }\r
+\r
+#endif\r
\r
\r
#include "FreeRTOS.h"\r
#include "task.h"\r
+#include "timers.h"\r
#include "StackMacros.h"\r
\r
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
#endif\r
/*-----------------------------------------------------------*/\r
\r
+void vTaskUnblockTask( xTaskHandle pxTask )\r
+{\r
+tskTCB *pxTCB = ( tskTCB * ) pxTask;\r
+\r
+ /* This function is not intended to be a public API function and definitely\r
+ is not for generic use as it assumes pxTask is not the running task and not\r
+ suspended, does not remove the task from any event lists it might be \r
+ blocked on, and does not take care of mutual exclusion. */\r
+ vListRemove( &( pxTCB->xGenericListItem ) );\r
+ prvAddTaskToReadyQueue( pxTCB );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
#if ( INCLUDE_uxTaskPriorityGet == 1 )\r
\r
unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle pxTask )\r
/* Add the idle task at the lowest priority. */\r
xReturn = xTaskCreate( prvIdleTask, ( signed char * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), ( xTaskHandle * ) NULL );\r
\r
+ #if ( configUSE_TIMERS == 1 )\r
+ {\r
+ if( xReturn == pdPASS )\r
+ {\r
+ xReturn = xTimerCreateTimerTask();\r
+ }\r
+ }\r
+ #endif\r
+\r
if( xReturn == pdPASS )\r
{\r
/* Interrupts are turned off here, to ensure a tick does not occur\r