Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/msp430/periph_uart: Fix uart_write() for USCI peripheral #20572

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cpu/msp430/periph/uart_usci.c
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,6 +16,7 @@
* @brief Low-level UART driver implementation
*
* @author Hauke Petersen <[email protected]>
* @author Marian Buschsieweke <[email protected]>
*
* @}
*/
Expand Down Expand Up @@ -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);
}
Expand Down
Loading