mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 17:17:44 -04:00
Add configASSERTs to alert when invalid parameters are passed into Queue Registry related functions.
Add a configASSERT when a queue is added to a QueueRegistry that is already full.
This commit is contained in:
parent
cc3f74b90f
commit
58ba569663
1 changed files with 9 additions and 0 deletions
9
queue.c
9
queue.c
|
@ -2725,6 +2725,9 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
|
|||
{
|
||||
UBaseType_t ux;
|
||||
|
||||
configASSERT( xQueue );
|
||||
configASSERT( pcQueueName );
|
||||
|
||||
/* See if there is an empty space in the registry. A NULL name denotes
|
||||
* a free slot. */
|
||||
for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ )
|
||||
|
@ -2743,6 +2746,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
|
|||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
/* Assert that the queue was added successfully */
|
||||
configASSERT( ( ux != configQUEUE_REGISTRY_SIZE ) );
|
||||
}
|
||||
|
||||
#endif /* configQUEUE_REGISTRY_SIZE */
|
||||
|
@ -2755,6 +2760,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
|
|||
UBaseType_t ux;
|
||||
const char * pcReturn = NULL; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
|
||||
configASSERT( xQueue );
|
||||
|
||||
/* Note there is nothing here to protect against another task adding or
|
||||
* removing entries from the registry while it is being searched. */
|
||||
|
||||
|
@ -2783,6 +2790,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
|
|||
{
|
||||
UBaseType_t ux;
|
||||
|
||||
configASSERT( xQueue );
|
||||
|
||||
/* See if the handle of the queue being unregistered in actually in the
|
||||
* registry. */
|
||||
for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue