diff --git a/bsp/at32/libraries/AT32F402_405_Firmware_Library/drivers/src/at32f402_405_usart.c b/bsp/at32/libraries/AT32F402_405_Firmware_Library/drivers/src/at32f402_405_usart.c index a6fe06efe1..0b9c450f13 100644 --- a/bsp/at32/libraries/AT32F402_405_Firmware_Library/drivers/src/at32f402_405_usart.c +++ b/bsp/at32/libraries/AT32F402_405_Firmware_Library/drivers/src/at32f402_405_usart.c @@ -115,7 +115,7 @@ void usart_init(usart_type* usart_x, uint32_t baud_rate, usart_data_bit_num_type crm_clocks_freq_type clocks_freq; uint32_t apb_clock, temp_val; crm_clocks_freq_get(&clocks_freq); - if((usart_x == USART1) || (usart_x == USART6) || (usart_x == UART7) || (usart_x == UART8)) + if((usart_x == USART1) || (usart_x == USART6)) { apb_clock = clocks_freq.apb2_freq; } diff --git a/bsp/at32/libraries/rt_drivers/drv_usart_v2.c b/bsp/at32/libraries/rt_drivers/drv_usart_v2.c index 57ccb36e11..a0c3455e9a 100644 --- a/bsp/at32/libraries/rt_drivers/drv_usart_v2.c +++ b/bsp/at32/libraries/rt_drivers/drv_usart_v2.c @@ -398,7 +398,9 @@ static rt_ssize_t at32_transmit(struct rt_serial_device *serial, rt_uint8_t *buf if(instance->uart_dma_flag & RT_DEVICE_FLAG_DMA_TX) { +#ifdef RT_SERIAL_USING_DMA _uart_dma_transmit(instance, buf, size); +#endif return size; }