0
0
FreeRTOSprogramming~5 mins

ISR-safe API functions (FromISR suffix) in FreeRTOS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AThey are safe to call inside Interrupt Service Routines.
BThey run faster than regular functions.
CThey allocate more memory.
DThey block until a resource is available.
Which parameter in 'FromISR' functions helps decide if a context switch is needed?
ApxHigherPriorityTaskWoken
BxQueueHandle
CxTicksToWait
DpvParameters
Can you call xQueueSend() directly inside an ISR?
AYes, always.
BOnly if interrupts are disabled.
CNo, use xQueueSendFromISR() instead.
DOnly if the queue is empty.
What happens if a 'FromISR' function sets pxHigherPriorityTaskWoken to pdTRUE?
ANothing happens.
BThe ISR must request a context switch after it finishes.
CThe ISR disables interrupts.
DThe system crashes.
Which of these is NOT true about 'FromISR' functions?
AThey never block.
BThey can be called from normal tasks.
CThey use special parameters for context switching.
DThey are unsafe 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.