Question
Debugger not entering the Callback interrupt functions
I wrote a simple program using interrupts:
Turns on the LD2 the diode if signs "O", "N" and enter are received respectively, turns off if "O", "F", "F" and enter are received otherwise (Im passing only the parts where I made changes :(
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stdio.h>
#include <string.h>
/* USER CODE END Includes */
......
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
#define LINE_MAX_LENGTH 80
static char line_buffer[LINE_MAX_LENGTH + 1];
static uint32_t line_length;
void line_append(uint8_t value)
{
if (value == '\r' || value == '\n') {
if (line_length > 0) {
line_buffer[line_length] = '\0';
if (strcmp(line_buffer, "on") == 0) {
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_SET);
} else if (strcmp(line_buffer, "off") == 0) {
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);
}
line_length = 0;
}
}
else {
if (line_length >= LINE_MAX_LENGTH) {
line_length = 0;
}
line_buffer[line_length++] = value;
}
}
uint8_t uart_rx_buffer;
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
if (huart == &huart2) {
line_append(uart_rx_buffer);
HAL_UART_Receive_IT(&huart2, &uart_rx_buffer, 1);
}
}
/* USER CODE END 0 */
Unfortunately, as it is shown in the picture up, the debugger is not entering the interrupt code part and I don't know why
