summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/soc/uart.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2022-09-04 18:20:46 +0200
committerUros Majstorovic <majstor@majstor.org>2022-09-04 18:20:46 +0200
commit4c96cd2d5f7cb8de7d48b5dbd728af7fda572d9d (patch)
tree8a744656cd26998781dc1a6699b826ff9a25e5fe /fw/fe310/eos/soc/uart.c
parent8f47a50abe4cbae953724ea4769fbd629ee9b801 (diff)
uart fixed
Diffstat (limited to 'fw/fe310/eos/soc/uart.c')
-rw-r--r--fw/fe310/eos/soc/uart.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fw/fe310/eos/soc/uart.c b/fw/fe310/eos/soc/uart.c
index 589832a..1cff781 100644
--- a/fw/fe310/eos/soc/uart.c
+++ b/fw/fe310/eos/soc/uart.c
@@ -121,3 +121,8 @@ int eos_uart_getc(int block) {
}
return r & 0xff;
}
+
+void eos_uart_flush_rx(void) {
+ volatile uint32_t r;
+ while (!(r = UART0_REG(UART_REG_RXFIFO) & 0x80000000));
+}