/* Read a single byte from the serial port. Returns 1 on success, 0 otherwise. When the function is successful, the character read is written into its argument c.  */
int serial_getc(void)
/* Read a single byte from the serial port. Returns 1 on success, 0 otherwise. When the function is successful, the character read is written into its argument c.  */
int serial_getc(void)
{
	volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
	unsigned char ch;
	while(base->uts & UTS_RXEMPTY);
	ch = (char)base->urxd[0];
	return ch;
}