0
0
FreeRTOSprogramming~10 mins

Why interrupt handling is critical in RTOS in FreeRTOS - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define an interrupt service routine (ISR) in FreeRTOS.

FreeRTOS
void vExampleISR(void) {
    BaseType_t xHigherPriorityTaskWoken = [1];
    // ISR code here
}
Drag options to blanks, or click blank then click option'
ApdFALSE
BpdTRUE
CpdPASS
DpdFAIL
Attempts:
3 left
💡 Hint
Common Mistakes
Using pdTRUE instead of pdFALSE to initialize xHigherPriorityTaskWoken.
2fill in blank
medium

Complete the code to notify a task from an ISR in FreeRTOS.

FreeRTOS
void vExampleISR(void) {
    BaseType_t xHigherPriorityTaskWoken = pdFALSE;
    vTaskNotifyGiveFromISR(taskHandle, [1]);
    portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
Drag options to blanks, or click blank then click option'
ANULL
BpdFALSE
CxHigherPriorityTaskWoken
D&xHigherPriorityTaskWoken
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the variable directly instead of its address.
Passing NULL which disables task wake notification.
3fill in blank
hard

Fix the error in the ISR code to correctly clear the interrupt flag.

FreeRTOS
void vExampleISR(void) {
    BaseType_t xHigherPriorityTaskWoken = pdFALSE;
    // Clear interrupt flag
    [1];
    vTaskNotifyGiveFromISR(taskHandle, &xHigherPriorityTaskWoken);
    portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
Drag options to blanks, or click blank then click option'
ACLEAR_INTERRUPT_FLAG()
Bclear_interrupt_flag()
CClearInterruptFlag()
DclearInterruptFlag()
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or camelCase function names that do not exist.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps interrupt names to their priority levels, only including priorities higher than 3.

FreeRTOS
interrupt_priorities = {name: level for name, level in interrupts.items() if level [1] [2]
Drag options to blanks, or click blank then click option'
A>
B3
C<
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' causing wrong filtering.
Using wrong threshold values.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps task names in uppercase to their stack sizes, only for tasks with stack size greater than 1000.

FreeRTOS
task_stacks = [1]: [2] for [3], [2] in tasks.items() if [2] > 1000
Drag options to blanks, or click blank then click option'
Aname.upper()
Bstack_size
Cname
Dtask
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names or forgetting to convert names to uppercase.