Skip to content

Commit 75c863c

Browse files
committed
add Flush for UART
1 parent ea183e9 commit 75c863c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/machine/machine_rp2040_uart.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,9 @@ func (uart *UART) handleInterrupt(interrupt.Interrupt) {
131131
}
132132
uart.Receive(byte((uart.Bus.UARTDR.Get() & 0xFF)))
133133
}
134+
135+
// Flush blocks until all bytes in UART transmit buffer have been sent over the wire.
136+
func (uart *UART) Flush() {
137+
for uart.Bus.UARTFR.HasBits(rp.UART0_UARTFR_BUSY) {
138+
}
139+
}

0 commit comments

Comments
 (0)