Complete the code to define the maximum interrupt priority from which FreeRTOS API functions can be called.
#define configMAX_SYSCALL_INTERRUPT_PRIORITY [1]
The macro configMAX_SYSCALL_INTERRUPT_PRIORITY sets the highest interrupt priority that can safely call FreeRTOS API functions.
Complete the code to mask interrupts above the maximum syscall priority in FreeRTOS.
portENTER_CRITICAL();
uint32_t priority = [1];
portEXIT_CRITICAL();configKERNEL_INTERRUPT_PRIORITY which is the lowest priority, not the maximum syscall priority.Interrupts with priority above configMAX_SYSCALL_INTERRUPT_PRIORITY are masked to protect critical sections.
Fix the error in the interrupt handler priority check to ensure it complies with FreeRTOS restrictions.
void ISR_Handler(void) {
if (NVIC_GetPriority(IRQn) [1] configMAX_SYSCALL_INTERRUPT_PRIORITY) {
// Safe to call FreeRTOS API
}
}Interrupts with priority numerically greater or equal to configMAX_SYSCALL_INTERRUPT_PRIORITY can safely call FreeRTOS APIs.
Fill both blanks to correctly define the interrupt priority grouping and the maximum syscall priority.
NVIC_SetPriorityGrouping([1]); #define configMAX_SYSCALL_INTERRUPT_PRIORITY [2]
Priority grouping NVIC_PRIORITYGROUP_4 is commonly used with FreeRTOS, and the max syscall priority is set to 3 in this example.
Fill all three blanks to create a dictionary comprehension that maps interrupt names to their priorities, filtering only those with priority less than the max syscall priority.
irq_priorities = {irq: [1] for irq, prio in irq_list.items() if prio [2] [3]This comprehension creates a dictionary of interrupts with priorities less than the max syscall priority, mapping IRQ names to their priority values.