* \defgroup xQueuePeekFromISR xQueuePeekFromISR\r
* \ingroup QueueManagement\r
*/\r
-signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, const void * const pvBuffer ) PRIVILEGED_FUNCTION;\r
+signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, void * const pvBuffer ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* queue. h\r
* \defgroup xQueueReceive xQueueReceive\r
* \ingroup QueueManagement\r
*/\r
-signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, const void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeek ) PRIVILEGED_FUNCTION;\r
+signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeek ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* queue. h\r
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR\r
* \ingroup QueueManagement\r
*/\r
-signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, const void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;\r
+signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* Utilities to query queues that are safe to use from an ISR. These utilities\r
/*\r
- FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
#define queueSEMAPHORE_QUEUE_ITEM_LENGTH ( ( unsigned portBASE_TYPE ) 0 )\r
#define queueMUTEX_GIVE_BLOCK_TIME ( ( portTickType ) 0U )\r
\r
+#if( configUSE_PREEMPTION == 0 )\r
+ /* If the cooperative scheduler is being used then a yield should not be\r
+ performed just because a higher priority task has been woken. */\r
+ #define queueYIELD_IF_USING_PREEMPTION()\r
+#else\r
+ #define queueYIELD_IF_USING_PREEMPTION() portYIELD_WITHIN_API()\r
+#endif\r
\r
/*\r
* Definition of the queue used by the scheduler.\r
/*\r
* Copies an item out of a queue.\r
*/\r
-static void prvCopyDataFromQueue( xQUEUE * const pxQueue, const void * const pvBuffer ) PRIVILEGED_FUNCTION;\r
+static void prvCopyDataFromQueue( xQUEUE * const pxQueue, void * const pvBuffer ) PRIVILEGED_FUNCTION;\r
\r
#if ( configUSE_QUEUE_SETS == 1 )\r
/*\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
+ 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
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) == pdTRUE )\r
{\r
- portYIELD_WITHIN_API();\r
+ queueYIELD_IF_USING_PREEMPTION();\r
}\r
}\r
}\r
/* The queue is a member of a queue set, and posting\r
to the queue set caused a higher priority task to\r
unblock. A context switch is required. */\r
- portYIELD_WITHIN_API();\r
+ queueYIELD_IF_USING_PREEMPTION();\r
}\r
}\r
else\r
our own so yield immediately. Yes it is ok to\r
do this from within the critical section - the\r
kernel takes care of that. */\r
- portYIELD_WITHIN_API();\r
+ queueYIELD_IF_USING_PREEMPTION();\r
}\r
}\r
}\r
our own so yield immediately. Yes it is ok to do\r
this from within the critical section - the kernel\r
takes care of that. */\r
- portYIELD_WITHIN_API();\r
+ queueYIELD_IF_USING_PREEMPTION();\r
}\r
}\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, const void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking )\r
+signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking )\r
{\r
signed portBASE_TYPE xEntryTimeSet = pdFALSE;\r
xTimeOutType xTimeOut;\r
{\r
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) == pdTRUE )\r
{\r
- portYIELD_WITHIN_API();\r
+ queueYIELD_IF_USING_PREEMPTION();\r
}\r
}\r
}\r
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )\r
{\r
/* The task waiting has a higher priority than this task. */\r
- portYIELD_WITHIN_API();\r
+ queueYIELD_IF_USING_PREEMPTION();\r
}\r
}\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, const void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken )\r
+signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken )\r
{\r
signed portBASE_TYPE xReturn;\r
unsigned portBASE_TYPE uxSavedInterruptStatus;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, const void * const pvBuffer )\r
+signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, void * const pvBuffer )\r
{\r
signed portBASE_TYPE xReturn;\r
unsigned portBASE_TYPE uxSavedInterruptStatus;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvCopyDataFromQueue( xQUEUE * const pxQueue, const void * const pvBuffer )\r
+static void prvCopyDataFromQueue( xQUEUE * const pxQueue, void * const pvBuffer )\r
{\r
if( pxQueue->uxQueueType != queueQUEUE_IS_MUTEX )\r
{\r
\r
#endif /* configUSE_QUEUE_SETS */\r
\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
/*\r
- FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
*/\r
#define tskIDLE_STACK_SIZE configMINIMAL_STACK_SIZE\r
\r
+#if( configUSE_PREEMPTION == 0 )\r
+ /* If the cooperative scheduler is being used then a yield should not be\r
+ performed just because a higher priority task has been woken. */\r
+ #define taskYIELD_IF_USING_PREEMPTION()\r
+#else\r
+ #define taskYIELD_IF_USING_PREEMPTION() portYIELD_WITHIN_API()\r
+#endif\r
+\r
/*\r
* Task control block. A task control block (TCB) is allocated for each task,\r
* and stores task state information, including a pointer to the task's context\r
then it should run now. */\r
if( pxCurrentTCB->uxPriority < uxPriority )\r
{\r
- portYIELD_WITHIN_API();\r
+ taskYIELD_IF_USING_PREEMPTION();\r
}\r
}\r
}\r
else if( pxStateList == &xSuspendedTaskList )\r
{\r
/* The task being queried is referenced from the suspended\r
- list. Is it genuinely suspended or is it block \r
+ list. Is it genuinely suspended or is it block\r
indefinitely? */\r
if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL )\r
{\r
\r
if( xYieldRequired == pdTRUE )\r
{\r
- portYIELD_WITHIN_API();\r
+ taskYIELD_IF_USING_PREEMPTION();\r
}\r
\r
/* Remove compiler warning about unused variables when the port\r
/* We may have just resumed a higher priority task. */\r
if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority )\r
{\r
- /* This yield may not cause the task just resumed to run, but\r
- will leave the lists in the correct state for the next yield. */\r
- portYIELD_WITHIN_API();\r
+ /* This yield may not cause the task just resumed to run,\r
+ but will leave the lists in the correct state for the\r
+ next yield. */\r
+ taskYIELD_IF_USING_PREEMPTION();\r
}\r
}\r
}\r
\r
if( xYieldPending == pdTRUE )\r
{\r
- xAlreadyYielded = pdTRUE;\r
- portYIELD_WITHIN_API();\r
+ #if( configUSE_PREEMPTION != 0 )\r
+ {\r
+ xAlreadyYielded = pdTRUE;\r
+ }\r
+ #endif\r
+ taskYIELD_IF_USING_PREEMPTION();\r
}\r
}\r
}\r
}\r
}\r
#endif /* ( ( configUSE_PREEMPTION == 1 ) && ( configUSE_TIME_SLICING == 1 ) ) */\r
- \r
+\r
#if ( configUSE_TICK_HOOK == 1 )\r
{\r
/* Guard against the tick hook being called when the pended tick\r
vApplicationTickHook();\r
}\r
}\r
- #endif /* configUSE_TICK_HOOK */ \r
+ #endif /* configUSE_TICK_HOOK */\r
}\r
else\r
{\r