Make early printf output nicer by inserting a carriage return before

any linefeeds that are output.
This commit is contained in:
Warner Losh 2014-01-25 21:57:45 +00:00
parent a500a7ce91
commit 1fb293548d

View file

@ -288,6 +288,10 @@ volatile uint32_t *at91_dbgu = (volatile uint32_t *)(AT91_BASE + AT91_DBGU0);
void
eputc(int c)
{
if (c == '\n')
eputc('\r');
while (!(at91_dbgu[USART_CSR / 4] & USART_CSR_TXRDY))
continue;
at91_dbgu[USART_THR / 4] = c;