/* 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 serial_getc(void)
/* 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 serial_getc(void)
{
	lh7a40x_uart_t* uart = LH7A40X_UART_PTR(UART_CONSOLE);
	while (uart->status & UART_RXFE);
	return(uart->data & 0xff);
}