From 893bb729071c8af9bfba2df5c7c1daed57afa448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E4=BC=A0=E7=A6=8F?= <46174387+zhouchuanfu@users.noreply.github.com> Date: Mon, 20 May 2019 10:21:00 +0800 Subject: [PATCH] Update drv_usart.c --- bsp/stm32/libraries/HAL_Drivers/drv_usart.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_usart.c b/bsp/stm32/libraries/HAL_Drivers/drv_usart.c index 2950266b3c..039d008341 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_usart.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_usart.c @@ -634,11 +634,13 @@ void LPUART1_DMA_RX_IRQHandler(void) #ifdef RT_SERIAL_USING_DMA static void stm32_dma_config(struct rt_serial_device *serial, rt_ubase_t flag) { - RT_ASSERT(serial != RT_NULL); struct rt_serial_rx_fifo *rx_fifo DMA_HandleTypeDef *DMA_Handle; struct dma_config *dma_config; - struct stm32_uart *uart = (struct stm32_uart *)serial->parent.user_data; + struct stm32_uart *uart; + + RT_ASSERT(serial != RT_NULL); + uart = (struct stm32_uart *)serial->parent.user_data; RT_ASSERT(uart != RT_NULL); if (RT_DEVICE_FLAG_DMA_RX == flag)