Complete the code to enter a critical section using FreeRTOS.
taskENTER_[1]();
// critical code here
taskEXIT_CRITICAL();The correct macro to enter a critical section is taskENTER_CRITICAL().
Complete the code to exit a critical section using FreeRTOS.
taskENTER_CRITICAL();
// critical code
taskEXIT_[1]();The correct macro to exit a critical section is taskEXIT_CRITICAL().
Fix the error in the code to properly protect the critical section.
taskENTER_CRITICAL(); shared_var += 1; [1]
After the critical code, you must call taskEXIT_CRITICAL() to exit the critical section.
Fill both blanks to create a safe critical section that increments a variable.
task[1]_CRITICAL(); count += 1; task[2]_CRITICAL();
Use taskENTER_CRITICAL() to start and taskEXIT_CRITICAL() to end the critical section.
Fill all three blanks to correctly enter and exit a critical section from within an ISR in FreeRTOS.
[1] uxSavedStatus; port[2]_CRITICAL_FROM_ISR( &uxSavedStatus ); // ISR critical code here port[3]_CRITICAL_FROM_ISR( uxSavedStatus );
In FreeRTOS ISRs, declare UBaseType_t uxSavedStatus, then portENTER_CRITICAL_FROM_ISR(&uxSavedStatus), critical code, then portEXIT_CRITICAL_FROM_ISR(uxSavedStatus).
