Skip to content

Commit

Permalink
Merge pull request #10615 from MrKevinWeiss/pr/debug/init
Browse files Browse the repository at this point in the history
cpu/stm32_common/uart: Prevent uart from sending if not initialized
  • Loading branch information
leandrolanzieri authored Dec 19, 2018
2 parents 3ce4b74 + 96f8438 commit b32da1b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cpu/stm32_common/periph/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
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
if (!len) {
return;
Expand Down

0 comments on commit b32da1b

Please sign in to comment.