summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-06-10 15:14:37 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-06-17 12:58:33 +0200
commit11cf6ae3e24a33a75ed18bc49585149d4e97a4e0 (patch)
tree76f39befd4b43da5ee2dd05abc6ae6a78bddb40c
parentgrlib: Fix apbuart_outbyte_polled() prototype (diff)
downloadrtems-11cf6ae3e24a33a75ed18bc49585149d4e97a4e0.tar.bz2
grlib: Simplify apbuart_inbyte_nonblocking()
-rw-r--r--bsps/shared/grlib/uart/apbuart_polled.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bsps/shared/grlib/uart/apbuart_polled.c b/bsps/shared/grlib/uart/apbuart_polled.c
index bf23e3a892..87325d8951 100644
--- a/bsps/shared/grlib/uart/apbuart_polled.c
+++ b/bsps/shared/grlib/uart/apbuart_polled.c
@@ -35,11 +35,11 @@ void apbuart_outbyte_polled(struct apbuart_regs *regs, char ch)
int apbuart_inbyte_nonblocking(struct apbuart_regs *regs)
{
/* Clear errors */
- if (regs->status & APBUART_STATUS_ERR)
- regs->status = ~APBUART_STATUS_ERR;
+ regs->status = ~APBUART_STATUS_ERR;
- if ((regs->status & APBUART_STATUS_DR) == 0)
+ if ((regs->status & APBUART_STATUS_DR) == 0) {
return -1;
- else
- return (int) regs->data;
+ }
+
+ return (uint8_t) regs->data;
}