void serial_isr (void *arg) { int space; int c; const int rx_get = buf_info.rx_get; int rx_put = buf_info.rx_put; if (rx_get <= rx_put) space = CONFIG_SERIAL_SOFTWARE_FIFO - (rx_put - rx_get); else space = rx_get - rx_put; while (serial_tstc_dev (ACTING_UART0_BASE)) { c = serial_getc_dev (ACTING_UART0_BASE); if (space) { buf_info.rx_buffer[rx_put++] = c; space--; } if (rx_put == CONFIG_SERIAL_SOFTWARE_FIFO) rx_put = 0; if (space < CONFIG_SERIAL_SOFTWARE_FIFO / 4) { /* Stop flow by setting RTS inactive */ out_8((u8 *)ACTING_UART0_BASE + UART_MCR, in_8((u8 *)ACTING_UART0_BASE + UART_MCR) & (0xFF ^ 0x02)); } } buf_info.rx_put = rx_put; }
int serial_tstc(void) { return serial_tstc_dev(CONFIG_PSC_CONSOLE); }
int serial1_tstc(void) { return serial_tstc_dev(PSC_BASE2); }
int serial0_tstc(void) { return (serial_tstc_dev(PSC_BASE)); }
int serial_tstc(void) { return serial_tstc_dev(ACTING_UART0_BASE); }
int serial1_tstc(void) { return (serial_tstc_dev(UART1_BASE)); }
int serial0_tstc(void) { return (serial_tstc_dev(UART0_BASE)); }