void ug_console_write(const char *buf, int len) { char *b = (char *)buf; while (len--) { if (*b == '\n') ug_putc('\r'); ug_putc(*b++); } }
/* * Transmits a character. * It silently fails if the TX fifo is not ready after a number of retries. */ static void ug_putc(char ch) { int count = UG_WRITE_ATTEMPTS; if (!ug_io_base) return; if (ch == '\n') ug_putc('\r'); while (!ug_is_txfifo_ready() && count--) barrier(); if (count >= 0) ug_raw_putc(ch); }
/* * Trasmits a null terminated character string. */ static void ug_puts(char *s) { while (*s) ug_putc(*s++); }