Complete the code to enable UART receive interrupt.
UART->CR1 |= [1];UART_CR1_RXNEIE enables the receive data register not empty interrupt.
Complete the code to clear the UART receive interrupt flag inside the ISR.
if (UART->ISR & UART_ISR_RXNE) { uint8_t data = UART->RDR; UART->ICR = [1]; }
Reading RDR clears RXNE flag automatically, but overrun error flag (ORE) must be cleared manually using UART_ICR_ORECF.
Fix the error in the UART interrupt handler to correctly read received data.
void USART1_IRQHandler(void) {
if (UART->ISR & [1]) {
uint8_t received = UART->RDR;
process(received);
}
}UART_ISR_RXNE indicates that data is ready to be read from the receive data register.
Fill both blanks to create a dictionary comprehension that maps received bytes to their ASCII codes only if the byte is a letter.
received_map = {byte: ord(byte) for byte in buffer if byte [1] [2]The comprehension filters bytes greater or equal to 'A' to include letters.
Fill all three blanks to build a dictionary comprehension that maps uppercase letters to their ASCII codes only if the code is less than 91.
uppercase_map = { [1] : [2] for [3] in buffer if ord([3]) < 91 }The comprehension uses 'char' as key and ord(char) as value for letters with ASCII less than 91 (uppercase letters).