0
0
FreeRTOSprogramming~10 mins

Deferred interrupt processing architecture in FreeRTOS - Interactive Code Practice

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

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

FreeRTOS
void v[1]Handler(void) {
    BaseType_t xHigherPriorityTaskWoken = pdFALSE;
    // ISR code here
}
Drag options to blanks, or click blank then click option'
AADC
BTimer
CGPIO
DUART
Attempts:
3 left
💡 Hint
Common Mistakes
Using a generic name instead of a specific peripheral name.
Forgetting to declare the ISR with the correct signature.
2fill in blank
medium

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

FreeRTOS
vTaskNotifyGiveFromISR(xTaskHandle, &[1]);
Drag options to blanks, or click blank then click option'
ApdTRUE
BxHigherPriorityTaskWoken
CpdFALSE
DNULL
Attempts:
3 left
💡 Hint
Common Mistakes
Passing pdTRUE or pdFALSE directly instead of the pointer variable.
Passing NULL which disables context switch notification.
3fill in blank
hard

Fix the error in the ISR to correctly perform deferred interrupt processing.

FreeRTOS
void vISR_Handler(void) {
    BaseType_t [1] = pdFALSE;
    // Clear interrupt flag
    vTaskNotifyGiveFromISR(xTaskHandle, &xHigherPriorityTaskWoken);
    portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
Drag options to blanks, or click blank then click option'
AxHigherPriorityTaskWoken
BxTaskWoken
CxInterruptFlag
DxNotifyFlag
Attempts:
3 left
💡 Hint
Common Mistakes
Using an undefined variable name.
Not calling portYIELD_FROM_ISR with the correct variable.
4fill in blank
hard

Fill both blanks to create a deferred interrupt processing task that waits for notification.

FreeRTOS
void vDeferredTask(void *pvParameters) {
    for(;;) {
        ulTaskNotifyTake([1], [2]);
        // Process interrupt data here
    }
}
Drag options to blanks, or click blank then click option'
ApdTRUE
BportMAX_DELAY
CpdFALSE
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using pdFALSE instead of pdTRUE for clearing notification.
Using 0 instead of portMAX_DELAY causing no wait.
5fill in blank
hard

Fill all three blanks to implement a deferred interrupt processing system with ISR notification and task wait.

FreeRTOS
void vISR_Handler(void) {
    BaseType_t [1] = pdFALSE;
    vTaskNotifyGiveFromISR(xTaskHandle, &[2]);
    [3]YIELD_FROM_ISR(xHigherPriorityTaskWoken);
}

void vDeferredTask(void *pvParameters) {
    for(;;) {
        ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
        // Handle deferred processing
    }
}
Drag options to blanks, or click blank then click option'
AxHigherPriorityTaskWoken
BxTaskWoken
Dport
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names inconsistently.
Omitting the 'port' prefix in portYIELD_FROM_ISR.