diff --git a/include/FreeRTOS.h b/include/FreeRTOS.h index 0775a6ece..8d587cebf 100644 --- a/include/FreeRTOS.h +++ b/include/FreeRTOS.h @@ -992,6 +992,23 @@ #define traceTASK_NOTIFY_TAKE( uxIndexToWait ) #endif +#ifndef traceTASK_NOTIFY_TAKE_EXT + +/* Extended version of traceTASK_NOTIFY_TAKE that also exposes value of + * xClearCountOnExit, informing the tracer of the state of this task + * notification after it has been taken. Note that this hook, unlike traceTASK_NOTIFY_TAKE, + * is only called if the notification was successfully taken. */ + #define traceTASK_NOTIFY_TAKE_EXT( uxIndexToWait, xClearCountOnExit ) traceTASK_NOTIFY_TAKE( uxIndexToWait ) +#endif + +#ifndef traceTASK_NOTIFY_TAKE_FAILED + +/* Task notification take failed. For backwards-compatability, this macro falls + * back on traceTASK_NOTIFY_TAKE which was always called, no matter if + * successfull or not. */ + #define traceTASK_NOTIFY_TAKE_FAILED( uxIndexToWait ) traceTASK_NOTIFY_TAKE( uxIndexToWait ) +#endif + #ifndef traceTASK_NOTIFY_WAIT_BLOCK #define traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait ) #endif diff --git a/tasks.c b/tasks.c index a049d64fe..e250ba768 100644 --- a/tasks.c +++ b/tasks.c @@ -7682,11 +7682,12 @@ TickType_t uxTaskResetEventItemValue( void ) taskENTER_CRITICAL(); { - traceTASK_NOTIFY_TAKE( uxIndexToWaitOn ); ulReturn = pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ]; if( ulReturn != 0U ) { + traceTASK_NOTIFY_TAKE_EXT( uxIndexToWaitOn, xClearCountOnExit ); + if( xClearCountOnExit != pdFALSE ) { pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] = ( uint32_t ) 0U; @@ -7698,6 +7699,7 @@ TickType_t uxTaskResetEventItemValue( void ) } else { + traceTASK_NOTIFY_TAKE_FAILED( uxIndexToWaitOn ); mtCOVERAGE_TEST_MARKER(); }