1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/stm32: uart: don't do DMA for small transfers

This commit is contained in:
Benjamin Valentin 2024-01-04 17:34:18 +01:00
parent 9710d4a23c
commit ca9bf1a29a

View File

@ -390,10 +390,8 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
}
#endif
#ifdef MODULE_PERIPH_DMA
if (!len) {
return;
}
if (uart_config[uart].dma != DMA_STREAM_UNDEF) {
if (len > CONFIG_UART_DMA_THRESHOLD_BYTES &&
uart_config[uart].dma != DMA_STREAM_UNDEF) {
if (irq_is_in()) {
uint16_t todo = 0;
if (dev(uart)->CR3 & USART_CR3_DMAT) {