From f677db1ff5454fa360d648a0bc9df607512e0269 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Mon, 1 Feb 2016 12:19:22 +0800 Subject: [PATCH] [libc] Add fputc/fgetc implementation for MICROLIB --- components/libc/armlibc/stubs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/components/libc/armlibc/stubs.c b/components/libc/armlibc/stubs.c index bd57ca4c54..395e51ecda 100644 --- a/components/libc/armlibc/stubs.c +++ b/components/libc/armlibc/stubs.c @@ -273,3 +273,19 @@ int system(const char *string) for (;;); } #endif + +#ifdef __MICROLIB +#include + +int fputc(int c, FILE *f) +{ + char ch = c; + + rt_kprintf(&ch); + return 1; +} + +int fgetc(FILE *f) { + return -1; +} +#endif