- cli();
- if (ao_fifo_empty(ao_usart1_rx_fifo)) {
- sei();
- return AO_READ_AGAIN;
- }
- ao_fifo_remove(ao_usart1_rx_fifo,c);
- sei();
+
+ ao_arch_block_interrupts();
+ while (ao_fifo_empty(ao_serial1_rx_fifo))
+ ao_sleep(&ao_serial1_rx_fifo);
+ ao_fifo_remove(ao_serial1_rx_fifo, c);
+ ao_arch_release_interrupts();