|
@@ -918,6 +918,7 @@ static void stm32_dma_config(struct rt_serial_device *serial, rt_ubase_t flag)
|
|
|
struct stm32_uart *uart;
|
|
|
|
|
|
RT_ASSERT(serial != RT_NULL);
|
|
|
+ RT_ASSERT(flag == RT_DEVICE_FLAG_DMA_TX || flag == RT_DEVICE_FLAG_DMA_RX);
|
|
|
uart = rt_container_of(serial, struct stm32_uart, serial);
|
|
|
|
|
|
if (RT_DEVICE_FLAG_DMA_RX == flag)
|
|
@@ -925,7 +926,7 @@ static void stm32_dma_config(struct rt_serial_device *serial, rt_ubase_t flag)
|
|
|
DMA_Handle = &uart->dma_rx.handle;
|
|
|
dma_config = uart->config->dma_rx;
|
|
|
}
|
|
|
- else if (RT_DEVICE_FLAG_DMA_TX == flag)
|
|
|
+ else /* RT_DEVICE_FLAG_DMA_TX == flag */
|
|
|
{
|
|
|
DMA_Handle = &uart->dma_tx.handle;
|
|
|
dma_config = uart->config->dma_tx;
|