Пример #1
0
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;
}
Пример #2
0
int serial_tstc(void)
{
	return serial_tstc_dev(CONFIG_PSC_CONSOLE);
}
Пример #3
0
int serial1_tstc(void)
{
	return serial_tstc_dev(PSC_BASE2);
}
Пример #4
0
int serial0_tstc(void)
{
	return (serial_tstc_dev(PSC_BASE));
}
Пример #5
0
int serial_tstc(void)
{
	return serial_tstc_dev(ACTING_UART0_BASE);
}
Пример #6
0
int serial1_tstc(void)
{
	return (serial_tstc_dev(UART1_BASE));
}
Пример #7
0
int serial0_tstc(void)
{
	return (serial_tstc_dev(UART0_BASE));
}