1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-31 17:31:18 +01:00

Merge pull request #12026 from gschorcht/cpu/esp32/printf_puts_fix

cpu/esp32: fixes printf and puts
This commit is contained in:
Kaspar Schleiser 2019-08-19 11:45:03 +02:00 committed by GitHub
commit b683205098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,8 +91,12 @@ int IRAM puts(const char *s)
if (!s) {
return EOF;
}
ets_printf("%s\n", s);
return strlen(s);
int len = strlen(s);
for (int i = 0; i < len; i++) {
__wrap_putchar(s[i]);
}
__wrap_putchar('\n');
return len;
}
char _printf_buf[PRINTF_BUFSIZ];
@ -105,7 +109,9 @@ int IRAM printf(const char* format, ...)
int ret = vsnprintf(_printf_buf, PRINTF_BUFSIZ, format, arglist);
if (ret > 0) {
ets_printf (_printf_buf);
for (int i = 0; i < ret; i++) {
__wrap_putchar(_printf_buf[i]);
}
}
va_end(arglist);