Skip to content

Commit d384eeb

Browse files
committed
Implement __putc_r
1 parent 7b648fe commit d384eeb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cores/esp8266/libc_replacements.c

+7
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ int ICACHE_RAM_ATTR _write_r(struct _reent* r, int file, char *ptr, int len) {
9292
return len;
9393
}
9494

95+
int ICACHE_RAM_ATTR _putc_r(struct _reent* r, int c, FILE* file) {
96+
if (file->_file == STDOUT_FILENO) {
97+
return ets_putc(c);
98+
}
99+
return EOF;
100+
}
101+
95102
int ICACHE_RAM_ATTR puts(const char * str) {
96103
char c;
97104
while((c = *str) != 0) {

0 commit comments

Comments
 (0)