\r
traceTAKE_MUTEX_RECURSIVE( pxMutex );\r
\r
- if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() ) /*lint !e961 Cast is not redundant as xTaskHandle is a typedef. */\r
+ if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() ) /*lint !e961 Cast is not redundant as xTaskHandle is a typedef. */\r
{\r
( pxMutex->u.uxRecursiveCallCount )++;\r
xReturn = pdPASS;\r
}\r
else\r
{\r
- /* Entry time was already set. */ \r
+ /* Entry time was already set. */\r
}\r
}\r
}\r
\r
/* RTOS ports that support interrupt nesting have the concept of a maximum\r
system call (or maximum API call) interrupt priority. Interrupts that are\r
- above the maximum system call priority are keep permanently enabled, even \r
+ above the maximum system call priority are keep permanently enabled, even\r
when the RTOS kernel is in a critical section, but cannot make any calls to\r
- FreeRTOS API functions. If configASSERT() is defined in FreeRTOSConfig.h \r
+ FreeRTOS API functions. If configASSERT() is defined in FreeRTOSConfig.h\r
then portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion\r
failure if a FreeRTOS API function is called from an interrupt that has been\r
assigned a priority above the configured maximum system call priority.\r
Only FreeRTOS functions that end in FromISR can be called from interrupts\r
- that have been assigned a priority at or (logically) below the maximum \r
- system call interrupt priority. FreeRTOS maintains a separate interrupt \r
- safe API to ensure interrupt entry is as fast and as simple as possible. \r
- More information (albeit Cortex-M specific) is provided on the following \r
+ that have been assigned a priority at or (logically) below the maximum\r
+ system call interrupt priority. FreeRTOS maintains a separate interrupt\r
+ safe API to ensure interrupt entry is as fast and as simple as possible.\r
+ More information (albeit Cortex-M specific) is provided on the following\r
link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
\r
\r
/* RTOS ports that support interrupt nesting have the concept of a maximum\r
system call (or maximum API call) interrupt priority. Interrupts that are\r
- above the maximum system call priority are keep permanently enabled, even \r
+ above the maximum system call priority are keep permanently enabled, even\r
when the RTOS kernel is in a critical section, but cannot make any calls to\r
- FreeRTOS API functions. If configASSERT() is defined in FreeRTOSConfig.h \r
+ FreeRTOS API functions. If configASSERT() is defined in FreeRTOSConfig.h\r
then portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion\r
failure if a FreeRTOS API function is called from an interrupt that has been\r
assigned a priority above the configured maximum system call priority.\r
Only FreeRTOS functions that end in FromISR can be called from interrupts\r
- that have been assigned a priority at or (logically) below the maximum \r
- system call interrupt priority. FreeRTOS maintains a separate interrupt \r
- safe API to ensure interrupt entry is as fast and as simple as possible. \r
- More information (albeit Cortex-M specific) is provided on the following \r
+ that have been assigned a priority at or (logically) below the maximum\r
+ system call interrupt priority. FreeRTOS maintains a separate interrupt\r
+ safe API to ensure interrupt entry is as fast and as simple as possible.\r
+ More information (albeit Cortex-M specific) is provided on the following\r
link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
\r
} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */\r
/*-----------------------------------------------------------*/\r
\r
+unsigned portBASE_TYPE uxQueueSpacesAvailable( const xQueueHandle xQueue )\r
+{\r
+unsigned portBASE_TYPE uxReturn;\r
+xQUEUE *pxQueue;\r
+\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
+ configASSERT( pxQueue );\r
+\r
+ taskENTER_CRITICAL();\r
+ uxReturn = pxQueue->uxLength - pxQueue->uxMessagesWaiting;\r
+ taskEXIT_CRITICAL();\r
+\r
+ return uxReturn;\r
+} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */\r
+/*-----------------------------------------------------------*/\r
+\r
unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle xQueue )\r
{\r
unsigned portBASE_TYPE uxReturn;\r