diff options
Diffstat (limited to 'ports/posix/src')
| -rw-r--r-- | ports/posix/src/port.h | 16 | ||||
| -rw-r--r-- | ports/posix/src/stream_stdio.c | 25 |
2 files changed, 41 insertions, 0 deletions
diff --git a/ports/posix/src/port.h b/ports/posix/src/port.h new file mode 100644 index 0000000..7c94ce8 --- /dev/null +++ b/ports/posix/src/port.h @@ -0,0 +1,16 @@ +/** + * + * @brief Port specific includes go in this file + * +*/ + +#ifndef __PORT_H +#define __PORT_H + +#include <pthread.h> +#include <mqueue.h> +#include <stdint.h> +#include <errno.h> +#include "stream.h" + +#endif diff --git a/ports/posix/src/stream_stdio.c b/ports/posix/src/stream_stdio.c new file mode 100644 index 0000000..d49c46e --- /dev/null +++ b/ports/posix/src/stream_stdio.c @@ -0,0 +1,25 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "stream_stdio.h" +#include "stream.h" +#include "main.h" + +int read_STDIO(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 write_STDIO(uint8_t* buf, size_t count, void **vptr, void *sptr) +{ + int x; + for (x = 0; x < count; x++) { + printf("%x", buf[x]); + } + printf("\n"); + return 0; +} |
