- char c;
- cli();
- if (ao_fifo_empty(usart->rx_fifo)) {
- sei();
- return AO_READ_AGAIN;
- }
- ao_fifo_remove(usart->rx_fifo,c);
- sei();
- return c;
+ int c;
+ ao_arch_block_interrupts();
+ while ((c = _ao_usart_pollchar(usart)) == AO_READ_AGAIN)
+ ao_sleep(&usart->rx_fifo);
+ ao_arch_release_interrupts();
+ return (char) c;