fix: preserve current runtime debug state

This commit is contained in:
2026-04-18 05:29:11 +08:00
parent 6aba77df9a
commit cd48a8af68
11 changed files with 138 additions and 265 deletions
+14 -2
View File
@@ -567,6 +567,7 @@ void config_uart_idle_handler(void)
uint16_t dma_counter = __HAL_DMA_GET_COUNTER(huart1.hdmarx);
uint16_t len = CONFIG_RX_BUFFER_SIZE - dma_counter;
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
HAL_StatusTypeDef hal_status;
if (g_uart1_tx_busy) {
return;
@@ -582,8 +583,19 @@ void config_uart_idle_handler(void)
&xHigherPriorityTaskWoken);
}
HAL_UART_DMAStop(&huart1);
HAL_UART_Receive_DMA(&huart1, g_uart1_rx_buffer, CONFIG_RX_BUFFER_SIZE);
hal_status = HAL_UART_DMAStop(&huart1);
if (hal_status != HAL_OK) {
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
return;
}
hal_status = HAL_UART_Receive_DMA(&huart1, g_uart1_rx_buffer, CONFIG_RX_BUFFER_SIZE);
if (hal_status != HAL_OK) {
__HAL_UART_DISABLE_IT(&huart1, UART_IT_IDLE);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
return;
}
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}