// Serial usage static void serial_putchar(int c) { // check how much fifo we've used and if we need to drain it if (fifo_used == fifo_depth) { wait_for_fifo(); } write_thr((uint8_t)c); if (c == '\n') { wait_for_fifo(); write_thr('\r'); } fifo_used++; }
void uart_putc(char c) { if (c == '\n') uart_putc('\r'); while (read_tcr() & ((1 << 7) - 1)) ; write_thr(c); }
static void serial_putchar(int c) { /* check how much fifo we've used and if we need to drain it */ if (fifo_used == fifo_depth) { wait_for_fifo(); } write_thr((uint8_t)c); fifo_used++; }