From 1fb36a0e60f5a000118dafed943bcdb61149d563 Mon Sep 17 00:00:00 2001 From: schilkp Date: Wed, 5 Jun 2024 11:10:52 +0200 Subject: [PATCH] Add traceQUEUE_RESET and traceQUEUE_RESET_FAILED hooks. xQueueGenericReset does not feature any tracing hooks besides the API ENTER and EXIT calls. This introduces two new tracing hooks that, in the same style as all other queue APIs, inform a tracer that a queue has been reset. --- include/FreeRTOS.h | 8 ++++++++ queue.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/include/FreeRTOS.h b/include/FreeRTOS.h index b972ffd10..83f687f35 100644 --- a/include/FreeRTOS.h +++ b/include/FreeRTOS.h @@ -813,6 +813,14 @@ #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue ) #endif +#ifndef traceQUEUE_RESET + #define traceQUEUE_RESET( pxQueue, xNewQueue ) +#endif + +#ifndef traceQUEUE_RESET_FAILED + #define traceQUEUE_RESET_FAILED( pxQueue, xNewQueue ) +#endif + #ifndef traceQUEUE_DELETE #define traceQUEUE_DELETE( pxQueue ) #endif diff --git a/queue.c b/queue.c index dd302c908..cec527a55 100644 --- a/queue.c +++ b/queue.c @@ -355,10 +355,14 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue, } } taskEXIT_CRITICAL(); + + traceQUEUE_RESET( pxQueue, xNewQueue ); } else { xReturn = pdFAIL; + + traceQUEUE_RESET_FAILED( pxQueue, xNewQueue ); } configASSERT( xReturn != pdFAIL );