1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 14:03:55 +01:00

Merge pull request #10942 from OTAkeys/fix/stm32_uart_dma

cpu/stm32_common: fix DMA releasing in UART driver
This commit is contained in:
Alexandre Abadie 2019-03-29 10:06:31 +01:00 committed by GitHub
commit fafc26819a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -309,12 +309,12 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
dev(uart)->CR3 |= USART_CR3_DMAT;
dma_transfer(uart_config[uart].dma, uart_config[uart].dma_chan, data,
(void *)&dev(uart)->TDR_REG, len, DMA_MEM_TO_PERIPH, DMA_INC_SRC_ADDR);
dma_release(uart_config[uart].dma);
/* make sure the function is synchronous by waiting for the transfer to
* finish */
wait_for_tx_complete(uart);
dev(uart)->CR3 &= ~USART_CR3_DMAT;
dma_release(uart_config[uart].dma);
}
return;
}