stdout: Bring back auto-CRLF behaviour as discussed

This commit is contained in:
Angus Gratton 2015-10-06 23:24:40 +11:00
parent 7d67bf2ede
commit 7efc0e3334

View file

@ -41,6 +41,11 @@ long _write_r(struct _reent *r, int fd, const char *ptr, int len )
return -1;
}
for(int i = 0; i < len; i++) {
/* Auto convert CR to CRLF, ignore other LFs (compatible with Espressif SDK behaviour) */
if(ptr[i] == '\r')
continue;
if(ptr[i] == '\n')
uart_putc(0, '\r');
uart_putc(0, ptr[i]);
}
return len;