mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-09 08:37:58 +08:00
grlib: Simplify apbuart_inbyte_nonblocking()
This commit is contained in:
1 parent
3af1e5e735
commit
11cf6ae3e2
1 file changed
+5
-5
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user