/* Read a single byte from the serial port. Returns 1 on success, 0 otherwise. When the function is succesfull, the character read is written into its argument c.  */
int pxa_getc_dev(unsigned int uart_index)
/* Read a single byte from the serial port. Returns 1 on success, 0 otherwise. When the function is succesfull, the character read is written into its argument c.  */
int pxa_getc_dev(unsigned int uart_index)
{
	switch (uart_index) {
		case FFUART_INDEX:
			while (!(FFLSR & LSR_DR))
			WATCHDOG_RESET ();
			return (char) FFRBR & 0xff;
		case BTUART_INDEX:
			while (!(BTLSR & LSR_DR))
			WATCHDOG_RESET ();
			return (char) BTRBR & 0xff;
		case STUART_INDEX:
			while (!(STLSR & LSR_DR))
			WATCHDOG_RESET ();
			return (char) STRBR & 0xff;
	}
	return -1;
}