Recall & Review
beginner
What does the 'FromISR' suffix in FreeRTOS API functions indicate?
It indicates that the function is safe to call from an Interrupt Service Routine (ISR). These functions are designed to be used in interrupt context without causing issues like blocking or priority inversion.
Click to reveal answer
beginner
Why can't regular FreeRTOS API functions be called directly from an ISR?
Regular FreeRTOS API functions may block or use operations that are not safe in interrupt context, such as waiting for a resource. ISRs must be fast and non-blocking, so special 'FromISR' versions are provided to be safe in ISRs.
Click to reveal answer
intermediate
How do 'FromISR' functions handle task switching differently?
They use a pointer parameter to indicate if a context switch should happen after the ISR completes. This allows the kernel to defer the switch safely until after the interrupt, maintaining system stability.
Click to reveal answer
beginner
Give an example of a FreeRTOS API function and its ISR-safe counterpart.
Example: xQueueSend() is the regular function to send to a queue. Its ISR-safe counterpart is xQueueSendFromISR(), which can be safely called inside an ISR.
Click to reveal answer
intermediate
What is the purpose of the 'pxHigherPriorityTaskWoken' parameter in 'FromISR' functions?
It is a pointer to a variable that the function sets to pdTRUE if calling the function caused a higher priority task to become ready to run. This informs the ISR that a context switch should be requested after the ISR finishes.
Click to reveal answer
What is the main reason to use 'FromISR' functions in FreeRTOS?
✗ Incorrect
FromISR functions are specifically designed to be safe when called inside ISRs, avoiding blocking and unsafe operations.
Which parameter in 'FromISR' functions helps decide if a context switch is needed?
✗ Incorrect
The pxHigherPriorityTaskWoken pointer is set by the function to indicate if a higher priority task was woken.
Can you call xQueueSend() directly inside an ISR?
✗ Incorrect
xQueueSend() is not safe in ISRs; the FromISR version must be used.
What happens if a 'FromISR' function sets pxHigherPriorityTaskWoken to pdTRUE?
✗ Incorrect
Setting pxHigherPriorityTaskWoken to pdTRUE signals that a higher priority task is ready and a context switch should occur.
Which of these is NOT true about 'FromISR' functions?
✗ Incorrect
'FromISR' functions are specifically designed to be safe in ISRs.
Explain why FreeRTOS provides 'FromISR' versions of API functions and how they differ from regular API calls.
Think about what makes interrupt routines special and how these functions avoid problems.
You got /4 concepts.
Describe the role of the pxHigherPriorityTaskWoken parameter in ISR-safe FreeRTOS API functions.
Consider how FreeRTOS decides when to switch tasks after an interrupt.
You got /4 concepts.