Complete the code to send a character to a queue safely from an ISR.
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
xQueueSendFromISR(queue, &[1], &xHigherPriorityTaskWoken);The variable data holds the character to send to the queue from the ISR.
Complete the code to yield from an ISR if a higher priority task was woken.
if (xHigherPriorityTaskWoken [1] pdTRUE) { portYIELD_FROM_ISR(); }
The condition checks if xHigherPriorityTaskWoken is equal to pdTRUE to decide if a context switch is needed.
Fix the error in the ISR-safe queue receive function call.
BaseType_t result = xQueueReceiveFromISR(queue, [1], NULL);The function expects a pointer to the buffer, so &buffer is correct.
Fill both blanks to correctly send data from an ISR and handle task wakeup.
BaseType_t xHigherPriorityTaskWoken = pdFALSE; if (xQueueSendFromISR(queue, &[1], &[2]) != pdPASS) { // Handle error }
data is the variable sent to the queue, and xHigherPriorityTaskWoken tracks if a higher priority task was woken.
Fill all three blanks to create an ISR-safe queue send and yield if needed.
BaseType_t [1] = pdFALSE; if (xQueueSendFromISR(queue, &[2], &[3]) == pdPASS) { portYIELD_FROM_ISR([3]); }
xHigherPriorityTaskWoken is declared and used to track if a higher priority task was woken. data is the variable sent to the queue.