int UARTClass::available(void) { sio_probe_rx(); return (!(sio_rxbuf_head == sio_rxbuf_tail)); }
int UARTClass::peek(void) { sio_probe_rx(); if (sio_rxbuf_tail == sio_rxbuf_head) return (-1); else return (sio_rxbuf[sio_rxbuf_tail]); }
int UARTClass::availableForWrite(void) { int in, busy; in = sio_probe_rx(); busy = (in & SIO_TX_BUSY) || (tx_xoff & 1); return (!busy); }
__attribute__((optimize("-Os"))) int sio_putchar(int c, int blocking) { int in, busy; do { in = sio_probe_rx(); busy = (in & SIO_TX_BUSY) || sio_tx_xoff; } while (blocking && busy); if (busy == 0) OUTB(IO_SIO_BYTE, c); return (busy); }
int UARTClass::sio_putchar(int c, int blocking) { int in, busy; do { in = sio_probe_rx(); busy = (in & SIO_TX_BUSY) || (tx_xoff & 1); } while (blocking && busy); if (busy == 0) serbase[IO_SIO_BYTE-IO_SIO_BYTE] = c; return (busy); }
__attribute__((optimize("-Os"))) int sio_getchar(int blocking) { int c, busy; /* Any new characters received from RS-232? */ do { sio_probe_rx(); busy = (sio_rxbuf_head == sio_rxbuf_tail); } while (blocking && busy); if (busy) return (-1); c = sio_rxbuf[sio_rxbuf_tail++]; sio_rxbuf_tail &= SIO_RXBUFMASK; return (c); }
int UARTClass::sio_getchar(int blocking) { int c, busy; /* Any new characters received from RS-232? */ do { sio_probe_rx(); busy = (sio_rxbuf_head == sio_rxbuf_tail); } while (blocking && busy); if (busy) return (-1); c = sio_rxbuf[sio_rxbuf_tail++]; sio_rxbuf_tail &= SIO_RXBUFMASK; return (c); }