Skip to content

Commit 4c75793

Browse files
committed
Fix undefined reference to putchar
1 parent 1fc8918 commit 4c75793

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cores/esp8266/libc_replacements.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ int ICACHE_RAM_ATTR puts(const char * str) {
4444
return ets_printf("%s", str);
4545
}
4646

47+
// newlib has 'putchar' defined to a big scary construct
48+
#undef putchar
49+
50+
int ICACHE_RAM_ATTR putchar(int c) {
51+
return ets_putc(c);
52+
}
53+
4754
int ICACHE_RAM_ATTR printf(const char* format, ...) {
4855
int ret;
4956
va_list arglist;

0 commit comments

Comments
 (0)