diff options
| author | Aditya Naik | 2020-08-03 14:42:06 -0400 |
|---|---|---|
| committer | Aditya Naik | 2020-08-03 14:42:06 -0400 |
| commit | 11a52e4e88bcad1e6bddcf02f78e1cc5eaaec508 (patch) | |
| tree | d7f725c30e618994a0650607ede73ab3efc72c67 /ports/posix | |
| parent | 81b3f3d5336eab67e8eb21bb4011e552f3895a4e (diff) | |
RTOS skeleton with (UNIX) POSIX calls. Reorg of stream files
Diffstat (limited to 'ports/posix')
| -rw-r--r-- | ports/posix/makefile | 12 | ||||
| -rw-r--r-- | ports/posix/src/stream_stdio.c | 18 |
2 files changed, 30 insertions, 0 deletions
diff --git a/ports/posix/makefile b/ports/posix/makefile new file mode 100644 index 0000000..9031b76 --- /dev/null +++ b/ports/posix/makefile @@ -0,0 +1,12 @@ + + +PREFIX = + +LDFLAGS = $(LIBDIR) $(LIBS) + +C_INCLUDES += \ +-Ilib/FreeRTOS/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/ \ + +C_SOURCES += \ +lib/FreeRTOS/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c \ +ports/posix/src/stream_stdio.c diff --git a/ports/posix/src/stream_stdio.c b/ports/posix/src/stream_stdio.c new file mode 100644 index 0000000..efa4b13 --- /dev/null +++ b/ports/posix/src/stream_stdio.c @@ -0,0 +1,18 @@ +#include <stdio.h> +#include "stream_stdio.h" +#include "stream.h" + +int stdio_read(uint8_t* buf, size_t count, void **vptr, void *sptr) +{ + int x; + for (x = 0; x < count; x++) { + scanf("%c", &buf[x]); + } + return 0; +} + +int stdio_write(uint8_t* buf, size_t count, void **vptr, void *sptr) +{ + printf("%s\n", buf); + return 0; +} |
