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

cpu/sam0/uart: skip uart_write() if uart isn't active

Otherwise we get stuck in an endless loop ...
This commit is contained in:
Jue 2022-10-28 20:13:03 +02:00
parent cf5e207d62
commit aa5ad12f37

View File

@ -303,6 +303,10 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
return;
}
if (!dev(uart)->CTRLA.bit.ENABLE) {
return;
}
#ifdef MODULE_PERIPH_UART_NONBLOCKING
for (const void* end = data + len; data != end; ++data) {
if (irq_is_in() || __get_PRIMASK()) {