-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Describe the bug
This issue was first reported on the FreeRTOS forums here https://forums.freertos.org/t/task-h-error-uxindextonotify-undeclared/10689
The macro ulTaskNotifyTakeIndexed was introduced with FreeRTOS 10.4.0. The implementation of the macro had a mismatch between the named macro parameters and the use of these parameters in the macro as follows:
As this macro was only introduced in V10.4.0 and the failure is at compile time we consider the potential risk from this bug to be very limited.
The offending code is shown here
#define ulTaskNotifyTakeIndexed( uxIndexToWaitOn, xClearCountOnExit, xTicksToWait )
ulTaskGenericNotifyTake( ( uxIndexToNotify ), ( xClearCountOnExit ), ( xTicksToWait ) )
To Reproduce
- Use the new macro ulTaskNotifyTakeIndexed as described in the forum post and you will observe a compilation error.
Additional context
The test code for this macro unfortunately had a local variable named uxIndexToNotify which masked the error during testing. The test was using this variable to pass the value into the macro which resulted in correct behavior because the variable name in the test was an exact match to the variable name incorrectly used in the macro implementation.
See this location for the exact code
https://github.com/FreeRTOS/FreeRTOS/blob/89d475e9b112d7b52c3d16aeff97e1e8e6b95316/FreeRTOS/Demo/Common/Minimal/TaskNotifyArray.c#L954