Skip to content

Commit

Permalink
fix(freertos): Fixed bug with prvENTER/EXIT_CRITICAL_OR_MASK_ISR() macro
Browse files Browse the repository at this point in the history
Fixed an undiscovered bug with prvENTER_CRITICAL_OR_MASK_ISR() and
prvEXIT_CRITICAL_OR_MASK_ISR() where the `uxInterruptStatus` argument was not
used.

However, all calls of this macro provide a local `uxSavedInterruptStatus`
variable, leading to this bug being hidden.
  • Loading branch information
Dazza0 committed Sep 1, 2023
1 parent 8904d6b commit 75a3c99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/freertos/FreeRTOS-Kernel/include/freertos/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -3458,10 +3458,10 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) PRIVILEGED_FUNCTION;
#define prvENTER_CRITICAL_OR_SUSPEND_ALL( x ) ( { vTaskSuspendAll(); ( void ) ( x ); } )
#define prvEXIT_CRITICAL_OR_RESUME_ALL( x ) xTaskResumeAll()
#define prvENTER_CRITICAL_OR_MASK_ISR( pxLock, uxInterruptStatus ) \
( uxSavedInterruptStatus ) = portSET_INTERRUPT_MASK_FROM_ISR(); \
( uxInterruptStatus ) = portSET_INTERRUPT_MASK_FROM_ISR(); \
( void ) ( pxLock );
#define prvEXIT_CRITICAL_OR_UNMASK_ISR( pxLock, uxInterruptStatus ) \
portCLEAR_INTERRUPT_MASK_FROM_ISR( ( uxSavedInterruptStatus ) ); \
portCLEAR_INTERRUPT_MASK_FROM_ISR( ( uxInterruptStatus ) ); \
( void ) ( pxLock );
#endif /* configNUM_CORES > 1 */

Expand Down

0 comments on commit 75a3c99

Please sign in to comment.