Explorar o código

[libc] Add fputc/fgetc implementation for MICROLIB

Bernard Xiong %!s(int64=9) %!d(string=hai) anos
pai
achega
f677db1ff5
Modificáronse 1 ficheiros con 16 adicións e 0 borrados
  1. 16 0
      components/libc/armlibc/stubs.c

+ 16 - 0
components/libc/armlibc/stubs.c

@@ -273,3 +273,19 @@ int system(const char *string)
     for (;;);
     for (;;);
 }
 }
 #endif
 #endif
+
+#ifdef __MICROLIB
+#include <stdio.h>
+
+int fputc(int c, FILE *f) 
+{
+    char ch = c;
+
+    rt_kprintf(&ch);
+    return 1;
+}
+
+int fgetc(FILE *f) {
+  return -1;
+}
+#endif