Skip to content
Snippets Groups Projects
Unverified Commit b32da1b1 authored by Leandro Lanzieri's avatar Leandro Lanzieri Committed by GitHub
Browse files

Merge pull request #10615 from MrKevinWeiss/pr/debug/init

cpu/stm32_common/uart: Prevent uart from sending if not initialized
parents 3ce4b745 96f8438e
No related branches found
No related tags found
No related merge requests found
...@@ -214,7 +214,12 @@ static inline void wait_for_tx_complete(uart_t uart) ...@@ -214,7 +214,12 @@ static inline void wait_for_tx_complete(uart_t uart)
void uart_write(uart_t uart, const uint8_t *data, size_t len) void uart_write(uart_t uart, const uint8_t *data, size_t len)
{ {
assert(uart < UART_NUMOF); assert(uart < UART_NUMOF);
#if DEVELHELP
/* If tx is not enabled don't try to send */
if (!(dev(uart)->CR1 & USART_CR1_TE)) {
return;
}
#endif
#ifdef MODULE_PERIPH_DMA #ifdef MODULE_PERIPH_DMA
if (!len) { if (!len) {
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment