Complete the code to initialize the microcontroller's UART for debugging output.
UART_Init([1]);The baud rate 115200 is commonly used for fast and reliable UART debugging communication.
Complete the code to turn on an LED connected to pin 13 for debugging purposes.
GPIO_WritePin(13, [1]);
Setting the pin to HIGH turns the LED on, which is useful for visual debugging.
Fix the error in the interrupt service routine declaration for debugging.
void [1] ISR_Handler(void) { /* handle interrupt */ }The '__interrupt' keyword is used in embedded C to declare an interrupt service routine.
Fill both blanks to create a dictionary-like structure mapping error codes to messages for debugging.
const char* error_messages[] = { [[1]] = "Overrun", [[2]] = "Timeout" };Error code 0 maps to "Overrun" and error code 2 maps to "Timeout" in this array initialization.
Fill all three blanks to implement a simple debug log function that prints a message only if debugging is enabled.
void debug_log(const char* msg) {
if ([1]) {
[2](msg);
[3]();
}
}The function checks if DEBUG_MODE is true, then prints the message with printf and flushes the output buffer with fflush.