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

Merge pull request #20572 from maribu/cpu/msp430/uart_usci

cpu/msp430/periph_uart: Fix uart_write() for USCI peripheral
This commit is contained in:
Marian Buschsieweke 2024-04-15 13:52:45 +00:00 committed by GitHub
commit 30c9204322
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 Freie Universität Berlin
* 2024 Marian Buschsieweke
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
@ -15,6 +16,7 @@
* @brief Low-level UART driver implementation
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Marian Buschsieweke <marian.buschsieweke@posteo.net>
*
* @}
*/
@ -130,6 +132,11 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
usci->dev->TXBUF = *data++;
}
while (usci->dev->STAT & UCBUSY) {
/* busy wait for completion, e.g. to avoid losing chars/bits
* before releasing the USCI in TX only mode. */
}
if (tx_only) {
msp430_usci_release(usci);
}