signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition );\r
unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle pxQueue );\r
void vQueueDelete( xQueueHandle xQueue );\r
-signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE xTaskPreviouslyWoken, portBASE_TYPE xCopyPosition );\r
+signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portBASE_TYPE xCopyPosition );\r
signed portBASE_TYPE xQueueGenericReceive( xQueueHandle pxQueue, const void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking );\r
signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle pxQueue, const void * const pvBuffer, signed portBASE_TYPE *pxTaskWoken );\r
xQueueHandle xQueueCreateMutex( void );\r
#endif /* configUSE_ALTERNATIVE_API */\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE xTaskPreviouslyWoken, portBASE_TYPE xCopyPosition )\r
+signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portBASE_TYPE xCopyPosition )\r
{\r
+signed portBASE_TYPE xReturn;\r
+\r
/* Similar to xQueueGenericSend, except we don't block if there is no room\r
in the queue. Also we don't directly wake a task that was blocked on a\r
queue read, instead we return a flag to say whether a context switch is\r
be done when the queue is unlocked later. */\r
if( pxQueue->xTxLock == queueUNLOCKED )\r
{\r
- /* We only want to wake one task per ISR, so check that a task has\r
- not already been woken. */\r
- if( !xTaskPreviouslyWoken ) \r
+ if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) )\r
{\r
- if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) )\r
+ if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )\r
{\r
- if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )\r
- {\r
- /* The task waiting has a higher priority so record that a\r
- context switch is required. */\r
- return pdTRUE;\r
- }\r
+ /* The task waiting has a higher priority so record that a\r
+ context switch is required. */\r
+ *pxHigherPriorityTaskWoken = pdTRUE;\r
}\r
}\r
}\r
knows that data was posted while it was locked. */\r
++( pxQueue->xTxLock );\r
}\r
+\r
+ xReturn = pdPASS;\r
}\r
else\r
{\r
traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue );\r
+ xReturn = errQUEUE_FULL;\r
}\r
\r
- return xTaskPreviouslyWoken;\r
+ return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
that an ISR has removed data while the queue was locked. */\r
if( pxQueue->xRxLock == queueUNLOCKED )\r
{\r
- /* We only want to wake one task per ISR, so check that a task has\r
- not already been woken. */\r
- if( !( *pxTaskWoken ) )\r
+ if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) )\r
{\r
- if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) )\r
+ if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE )\r
{\r
- if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE )\r
- {\r
- /* The task waiting has a higher priority than us so\r
- force a context switch. */\r
- *pxTaskWoken = pdTRUE;\r
- }\r
+ /* The task waiting has a higher priority than us so\r
+ force a context switch. */\r
+ *pxTaskWoken = pdTRUE;\r
}\r
}\r
}\r