diff options
Diffstat (limited to 'ports')
| -rw-r--r-- | ports/posix/makefile | 1 | ||||
| -rw-r--r-- | ports/posix/src/port.h | 2 | ||||
| -rw-r--r-- | ports/posix/src/stream_stdio.c | 16 | ||||
| -rw-r--r-- | ports/stm32f4/src/stream_i2c.c | 6 |
4 files changed, 6 insertions, 19 deletions
diff --git a/ports/posix/makefile b/ports/posix/makefile index 6b9367e..58d42be 100644 --- a/ports/posix/makefile +++ b/ports/posix/makefile @@ -11,4 +11,3 @@ C_INCLUDES += \ C_SOURCES += \ lib/FreeRTOS/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c \ ports/posix/src/stream_stdio.c \ -ports/posix/src/port_devices.c diff --git a/ports/posix/src/port.h b/ports/posix/src/port.h index 6f10699..7c94ce8 100644 --- a/ports/posix/src/port.h +++ b/ports/posix/src/port.h @@ -13,6 +13,4 @@ #include <errno.h> #include "stream.h" -int initialize_devices(int num_devices, p_stream_t *streams); - #endif diff --git a/ports/posix/src/stream_stdio.c b/ports/posix/src/stream_stdio.c index e9b6f09..d49c46e 100644 --- a/ports/posix/src/stream_stdio.c +++ b/ports/posix/src/stream_stdio.c @@ -1,21 +1,11 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "stream_stdio.h" #include "stream.h" #include "main.h" -int stdio_init(void **vptr, void *sptr) -{ - /* TODO */ - /* p_stream_t *stream = (p_stream_t*)sptr; */ - /* int num_files = BUS_DEVICE_LIMIT; */ - /* int x; */ - /* char fname_base[] = "devio_", fname[10]; */ - - return 0; -} - -int stdio_read(uint8_t* buf, size_t count, void **vptr, void *sptr) +int read_STDIO(uint8_t* buf, size_t count, void **vptr, void *sptr) { int x; for (x = 0; x < count; x++) { @@ -24,7 +14,7 @@ int stdio_read(uint8_t* buf, size_t count, void **vptr, void *sptr) return 0; } -int stdio_write(uint8_t* buf, size_t count, void **vptr, void *sptr) +int write_STDIO(uint8_t* buf, size_t count, void **vptr, void *sptr) { int x; for (x = 0; x < count; x++) { diff --git a/ports/stm32f4/src/stream_i2c.c b/ports/stm32f4/src/stream_i2c.c index 8c6c65b..621e11e 100644 --- a/ports/stm32f4/src/stream_i2c.c +++ b/ports/stm32f4/src/stream_i2c.c @@ -2,7 +2,7 @@ #include "port.h" #include "stream.h" -int i2c_read(uint8_t* buf, size_t count, void **vptr, void *sptr) +int read_I2C(uint8_t* buf, size_t count, void **vptr, void *sptr) { p_stream_t *stream = (p_stream_t*)sptr; I2C_HandleTypeDef dev = *(I2C_HandleTypeDef*)stream->props[0]; @@ -23,7 +23,7 @@ int i2c_read(uint8_t* buf, size_t count, void **vptr, void *sptr) return 0; } -int i2c_write(uint8_t* buf, size_t count, void **vptr, void *sptr) +int write_I2C(uint8_t* buf, size_t count, void **vptr, void *sptr) { p_stream_t *stream = (p_stream_t*)sptr; I2C_HandleTypeDef dev = *(I2C_HandleTypeDef*)stream->props[0]; @@ -32,6 +32,6 @@ int i2c_write(uint8_t* buf, size_t count, void **vptr, void *sptr) while (HAL_I2C_Master_Transmit(&dev, addr, buf, count, timeout) != HAL_OK) { return HAL_I2C_GetError(&dev); - } + } return 0; } |
