stdout: Bring back auto-CRLF behaviour as discussed
This commit is contained in:
parent
7d67bf2ede
commit
7efc0e3334
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue