FreeBSD/sys/arm/at91/uart_dev_at91usart.c
/*
 * Block waiting for a character.
 */
Block waiting for a character.
Block waiting for a character .
static int
at91_usart_getc(struct uart_bas *bas, struct mtx *hwmtx)
{
	int c;
	uart_lock(hwmtx);
	while (!(RD4(bas, USART_CSR) & USART_CSR_RXRDY)) {
		uart_unlock(hwmtx);
		DELAY(4);
		uart_lock(hwmtx);
	}
	c = RD4(bas, USART_RHR) & 0xff;
	uart_unlock(hwmtx);
	return (c);
}
static int at91_usart_getc ( struct uart_bas * bas , struct mtx * hwmtx ) { int c ; uart_lock ( hwmtx ) ; while ( ! ( RD4 ( bas , USART_CSR ) & USART_CSR_RXRDY ) ) { uart_unlock ( hwmtx ) ; DELAY ( 4 ) ; uart_lock ( hwmtx ) ; } c = RD4 ( bas , USART_RHR ) & 0xff ; uart_unlock ( hwmtx ) ; return ( c ) ; }
Block waiting for a character.
Block waiting for a character .