From: richardbarry Date: Sun, 23 Mar 2008 15:58:27 +0000 (+0000) Subject: Add utilities that can be used to query a queue from within an ISR. X-Git-Tag: V4.8.0~29 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=16ce9f3fd84c29d9c61ab488ce77fa5f162de8f7;p=freertos Add utilities that can be used to query a queue from within an ISR. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@253 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/include/queue.h b/Source/include/queue.h index be561ad67..2ba816ae2 100644 --- a/Source/include/queue.h +++ b/Source/include/queue.h @@ -911,7 +911,6 @@ void vQueueDelete( xQueueHandle xQueue ); */ #define xQueueSendToBackFromISR( pxQueue, pvItemToQueue, xTaskPreviouslyWoken ) xQueueGenericSendFromISR( pxQueue, pvItemToQueue, xTaskPreviouslyWoken, queueSEND_TO_BACK ) - /** * queue. h *
@@ -1165,6 +1164,15 @@ signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void
  */
 signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle pxQueue, const void * const pvBuffer, signed portBASE_TYPE *pxTaskWoken );
 
+/*
+ * Utilities to query queue that are safe to use from an ISR.  These utilities
+ * should be used only from witin an ISR, or within a critical section.
+ */
+signed portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle pxQueue );
+signed portBASE_TYPE xQueueIsQueueFullFromISR( const xQueueHandle pxQueue );
+signed portBASE_TYPE xQueueMessagesWaitingFromISR( const xQueueHandle pxQueue, unsigned portBASE_TYPE *puxMessagesWaiting );
+
+
 /* 
  * xQueueAltGenericSend() is an alternative version of xQueueGenericSend().
  * Likewise xQueueAltGenericReceive() is an alternative version of
@@ -1214,6 +1222,7 @@ xQueueHandle xQueueCreateCountingSemaphore( unsigned portBASE_TYPE uxCountValue,
 portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle xMutex, portTickType xBlockTime );
 portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle xMutex );
 
+
 #ifdef __cplusplus
 }
 #endif