fix: preserve current runtime debug state
This commit is contained in:
+14
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user