From 491524cb9621f85c011215748d30709fc4578adf Mon Sep 17 00:00:00 2001 From: Sherman Date: Wed, 23 Jun 2021 18:35:19 +0800 Subject: [components]rt-link v0.2.0 新特性: 1. service 通道增加【连接状态】属性 2. service 通道增加发送消息质量配置,ACK、CRC 可配置开关; 3. 发送接口支持阻塞、非阻塞两种发送方式; 4. 已对接到 device 框架,支持 rt_device 接口操作 5. 已对接到 DFS 框架,支持 POSIX 接口操作 6. 移除 hw_port 目录,改为软件包方式添加 hw_port 7. 修复已知 BUG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/rt-link/rtlink_dev_example.c | 395 ++++++++++++++++++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 examples/rt-link/rtlink_dev_example.c (limited to 'examples/rt-link/rtlink_dev_example.c') diff --git a/examples/rt-link/rtlink_dev_example.c b/examples/rt-link/rtlink_dev_example.c new file mode 100644 index 0000000000..0a026bcb3d --- /dev/null +++ b/examples/rt-link/rtlink_dev_example.c @@ -0,0 +1,395 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-06-19 Sherman the first version + */ + +#include +#include + +#define DBG_TAG "example" +#define DBG_LVL DBG_LOG +#include +#include + +enum +{ + NONE_TEST = 0, + SHORT_FRAME_TEST, + LONG_FRAME_TEST +}; +static rt_uint8_t speed_test_type = NONE_TEST; + +static struct rt_link_device rtlink_dev = {0}; +#define RTLINK01 "rtlink01" +#define TEST_CONTEXT "This message is sent by RT-Link" +rt_uint8_t test_buff[1024] = {0}; + +static rt_err_t rtlink_dev_rx_ind(rt_device_t dev, rt_size_t size) +{ + RT_ASSERT(dev != RT_NULL); + LOG_I("rx_ind: dev name %s, rx size %d", dev->parent.name, size); + return RT_EOK; +} + +static rt_err_t rtlink_dev_tx_done(rt_device_t dev, void *buffer) +{ + RT_ASSERT(dev != RT_NULL); + struct rt_link_device *rtlink_dev = (struct rt_link_device *)dev; + LOG_I("tx_done: dev name %s, buffer 0x%p errno %d", dev->parent.name, buffer, rtlink_dev->service.err); + rt_free(buffer); + return RT_EOK; +} + +#ifdef RT_USING_POSIX +#include +#include +#include + +#define RTLINK01_PATH "/dev/rtlink01" +int fd = -1; + +static void rtlink_fopen(int argc, char *argv[]) +{ + fd = open(RTLINK01_PATH, O_RDWR | O_NONBLOCK); + + if (fd < 0) + { + LOG_E("open rt_link failed!"); + } +} +MSH_CMD_EXPORT(rtlink_fopen, rtlink posix interface example); + +static void rtlink_fclose(int argc, char *argv[]) +{ + LOG_D("colse %d", fd); + close(fd); + fd = -1; +} +MSH_CMD_EXPORT(rtlink_fclose, rtlink posix interface example); + +static void rtlink_fread(int argc, char *argv[]) +{ + int read_len; + read_len = read(fd, test_buff, sizeof(test_buff)); + LOG_D("read len %d", read_len); + LOG_HEX("read", 8, test_buff, 32); +} +MSH_CMD_EXPORT(rtlink_fread, rtlink posix interface example); + +static void rtlink_fwrite(int argc, char *argv[]) +{ + char *data = RT_NULL; + rt_size_t length = 0; + rt_uint16_t count = 0; + rt_size_t ret = 0; + + if (argc == 1) + { + data = rt_malloc(sizeof(TEST_CONTEXT)); + if (data) + { + length = sizeof(TEST_CONTEXT) - 1; + rt_memcpy(data, TEST_CONTEXT, sizeof(TEST_CONTEXT) - 1); + ret = write(fd, data, length); + } + LOG_I("write data(0x%p) result: %d.", data, ret); + } + else if (argc >= 3) + { + if (strcmp(argv[1], "-l") == 0) + { + data = rt_malloc(atoi((const char *)argv[2])); + if (data) + { + for (count = 0; count < atoi((const char *)argv[2]); count++) + { + data[count] = (count % 93 + 33); + } + length = atoi((const char *)argv[2]); + ret = write(fd, data, length); + } + LOG_I("write data(0x%p) result: %d.", data, ret); + } + else + { + LOG_E("Invalid parameter."); + } + } +} +MSH_CMD_EXPORT(rtlink_fwrite, rtlink posix interface example); + +#define RTLINK02 "rtlink02" +#define RTLINK02_PATH "/dev/rtlink02" +static struct rt_link_device rtlink_fd = {0}; +rt_uint8_t fd_buff[1024] = {0}; + +static void listen_thread(void *param) +{ + int fd = open(RTLINK02_PATH, O_RDWR | O_NONBLOCK); + if (fd < 0) + { + LOG_E("open (%s) failed", RTLINK02); + return; + } + while (1) + { + rt_uint8_t *write_buf = RT_NULL; + int write_len = 0; + fd_set readfds, writefds; + FD_ZERO(&readfds); + FD_ZERO(&writefds); + FD_SET(fd, &readfds); + FD_SET(fd, &writefds); + + int ret = select(fd + 1, &readfds, &writefds, RT_NULL, RT_NULL); + LOG_D("select ret(%d), read (%d), write (%d)", ret, readfds, writefds); + if (FD_ISSET(fd, &readfds)) + { + LOG_I("POLLIN"); + int read_len = read(fd, fd_buff, sizeof(test_buff)); + LOG_D("read len %d", read_len); + LOG_HEX("read", 8, test_buff, 32); + } + + if (FD_ISSET(fd, &writefds)) + { + LOG_I("POLLOUT"); + write_buf = rt_malloc(1024); + if (write_buf) + { + write_len = write(fd, write_buf, 1024); + LOG_D("write %d", write_len); + } + } + + rt_thread_delay(500); + } + LOG_I("fd (%s) listen thread exit", RTLINK02); +} + +static void rtlink_fselect() +{ + /* step1: register rtlink to to the device framework */ + rt_link_dev_register(&rtlink_fd, RTLINK02, + RT_DEVICE_FLAG_RDWR | + RT_DEVICE_FLAG_REMOVABLE | + RT_DEVICE_FLAG_STANDALONE, + RT_NULL); + + /* step2: Initialize the rlink device as the default configuration, */ + rt_device_t device = rt_device_find(RTLINK02); + if (device == RT_NULL) + { + LOG_E("device not find!"); + return ; + } + rt_device_init(device); + + /* step3: config rtlink device rx/tx callback, channel, send timeout */ + rt_device_set_rx_indicate(device, rtlink_dev_rx_ind); + rt_device_set_tx_complete(device, rtlink_dev_tx_done); + struct rt_link_service service; + service.service = RT_LINK_SERVICE_MNGT; + service.timeout_tx = RT_WAITING_NO; + rt_device_control(device, RT_DEVICE_CTRL_CONFIG, &service); + + rt_thread_t tid = rt_thread_create(RTLINK02, listen_thread, RT_NULL, 1024, 21, 20); + if (tid) + { + rt_thread_startup(tid); + } +} +MSH_CMD_EXPORT(rtlink_fselect, rtlink posix interface example); +#endif /* RT_USING_POSIX */ + +static void rtlink_dread(void) +{ + rt_size_t read_len = 0; + rt_device_t dev = rt_device_find(RTLINK01); + if (dev == RT_NULL) + { + LOG_E("dev %s not find ", RTLINK01); + return; + } + + read_len = rt_device_read(dev, 0, test_buff, sizeof(test_buff)); + + LOG_D("read len %d", read_len); + LOG_HEX("read", 8, test_buff, 32); +} +MSH_CMD_EXPORT(rtlink_dread, rtlink device interface example); + +void rt_link_speed_test(void *paremeter) +{ + int ret; + rt_uint8_t *send_buf, *data; + rt_size_t bufflen = 0; + rt_size_t sentlen = 0; + rt_size_t count = 0; + rt_tick_t tick1, tick2; + rt_size_t total = 0; + rt_uint32_t integer, decimal; + rt_device_t dev = rt_device_find(RTLINK01); + if (dev == RT_NULL) + { + LOG_E("dev %s not find!", RTLINK01); + return ; + } + + if (speed_test_type == SHORT_FRAME_TEST) + { + bufflen = 988; + } + else + { + bufflen = 3036; + } + + send_buf = rt_malloc(bufflen); + if (send_buf != RT_NULL) + { + data = send_buf; + for (count = 0; count < bufflen; count++) + { + *data++ = (count % 93 + 33); + } + } + else + { + rt_kprintf("speed of send buffer malloc failed."); + return; + } + + tick1 = rt_tick_get(); + while (speed_test_type) + { + ret = rt_device_write(dev, 0, send_buf, bufflen); + + if (ret == RT_EOK) + { + sentlen += bufflen; + } + + tick2 = rt_tick_get(); + if (tick2 - tick1 >= RT_TICK_PER_SECOND) + { + total = sentlen * RT_TICK_PER_SECOND / 125 / (tick2 - tick1); + integer = total / 1000; + decimal = total % 1000; + LOG_I("%d.%03d0 Mbps!", integer, decimal); + sentlen = 0; + tick1 = tick2; + } + } + rt_free(send_buf); + LOG_W("speed test end, type %d", speed_test_type); +} + +void create_thead_to_test_speed(rt_uint8_t mutil_num) +{ + rt_uint8_t i = 0; + + LOG_D("Speed test type [%02d], mutil [%02d]", speed_test_type, mutil_num); + for (i = 0; i < mutil_num; i++) + { + rt_thread_t tid; + char tid_name[RT_NAME_MAX + 1] = {0}; + + rt_snprintf(tid_name, sizeof(tid_name), "lny_s%03d", i + 1); + tid = rt_thread_create(tid_name, rt_link_speed_test, RT_NULL, 1024, 20, 10); + rt_thread_startup(tid); + LOG_I("Speed test thread[%s] startup", tid_name); + } +} + +static void rtlink_dwrite(int argc, char *argv[]) +{ + char *data = RT_NULL; + rt_size_t length = 0; + rt_uint16_t count = 0; + rt_size_t ret = RT_ERROR; + + rt_device_t dev = rt_device_find(RTLINK01); + if (dev == RT_NULL) + { + LOG_E("device not find!"); + return ; + } + + if (argc == 1) + { + data = rt_malloc(sizeof(TEST_CONTEXT)); + length = sizeof(TEST_CONTEXT) - 1; + rt_memcpy(data, TEST_CONTEXT, sizeof(TEST_CONTEXT) - 1); + + ret = rt_device_write(dev, 0, data, length); + LOG_I("write data(0x%p) result: %d.", data, ret); + } + else if (argc >= 3) + { + if (strcmp(argv[1], "-l") == 0) + { + data = rt_malloc(atoi((const char *)argv[2])); + for (count = 0; count < atoi((const char *)argv[2]); count++) + { + data[count] = (count % 93 + 33); + } + length = atoi((const char *)argv[2]); + ret = rt_device_write(dev, 0, data, length); + LOG_I("write data(0x%p) result: %d.", data, ret); + } + else + { + LOG_E("Invalid parameter."); + } + } +} +MSH_CMD_EXPORT(rtlink_dwrite, rtlink device interface example); + +static void rtlink_dinit(void) +{ + /* step1: register rtlink to to the device framework */ + rt_link_dev_register(&rtlink_dev, RTLINK01, + RT_DEVICE_FLAG_RDWR | + RT_DEVICE_FLAG_REMOVABLE | + RT_DEVICE_FLAG_STANDALONE, + RT_NULL); + + /* step2: Initialize the rlink device as the default configuration, */ + rt_device_t device = rt_device_find(RTLINK01); + if (device == RT_NULL) + { + LOG_E("device not find!"); + return ; + } + rt_device_init(device); + + /* step3: config rtlink device rx/tx callback, channel, send timeout */ + rt_device_set_rx_indicate(device, rtlink_dev_rx_ind); + rt_device_set_tx_complete(device, rtlink_dev_tx_done); + struct rt_link_service service; + service.service = RT_LINK_SERVICE_SOCKET; + service.timeout_tx = RT_WAITING_FOREVER; + service.flag = RT_LINK_FLAG_ACK | RT_LINK_FLAG_CRC; + rt_device_control(device, RT_DEVICE_CTRL_CONFIG, &service); +} +MSH_CMD_EXPORT(rtlink_dinit, rtlink device interface example); + +static void rtlink_dopen() +{ + /* step4: open rtlink device, attach the service channel */ + rt_device_t device = rt_device_find(RTLINK01); + if (device == RT_NULL) + { + LOG_E("device not find!"); + return ; + } + rt_err_t ret = rt_device_open(device, RT_DEVICE_OFLAG_RDWR); + LOG_I("dev open ret %d", ret); +} +MSH_CMD_EXPORT(rtlink_dopen, rtlink device interface example); -- cgit v1.3.1 From c360688714d3aaf1f2114c45afaa3ee2ddc64fdd Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sat, 11 Sep 2021 11:48:14 -0400 Subject: 使用poll.h代替dfs_poll.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/src/dfs_poll.c | 2 +- components/dfs/src/dfs_select.c | 2 +- components/drivers/serial/serial.c | 2 +- components/drivers/serial/serial_v2.c | 2 +- components/drivers/src/pipe.c | 2 +- components/libc/compilers/common/poll.h | 9 +++++++++ components/lwp/lwp_syscall.c | 2 +- components/net/at/at_socket/at_socket.c | 2 +- components/net/sal_socket/impl/af_inet_at.c | 2 +- components/net/sal_socket/impl/af_inet_lwip.c | 2 +- components/net/sal_socket/socket/net_sockets.c | 2 +- components/utilities/rt-link/src/rtlink_dev.c | 2 +- examples/rt-link/rtlink_dev_example.c | 2 +- 13 files changed, 21 insertions(+), 12 deletions(-) (limited to 'examples/rt-link/rtlink_dev_example.c') diff --git a/components/dfs/src/dfs_poll.c b/components/dfs/src/dfs_poll.c index d1e0372494..607b3487be 100644 --- a/components/dfs/src/dfs_poll.c +++ b/components/dfs/src/dfs_poll.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #ifdef RT_USING_POSIX diff --git a/components/dfs/src/dfs_select.c b/components/dfs/src/dfs_select.c index c9286ca97f..ca9c549259 100644 --- a/components/dfs/src/dfs_select.c +++ b/components/dfs/src/dfs_select.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #ifdef RT_USING_POSIX diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index c567e34b52..289d523bd2 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -38,7 +38,7 @@ #ifdef RT_USING_POSIX #include -#include +#include #include #ifdef RT_USING_POSIX_TERMIOS diff --git a/components/drivers/serial/serial_v2.c b/components/drivers/serial/serial_v2.c index 6e65457a5d..390dd31748 100644 --- a/components/drivers/serial/serial_v2.c +++ b/components/drivers/serial/serial_v2.c @@ -18,7 +18,7 @@ #ifdef RT_USING_POSIX #include -#include +#include #include #ifdef getc diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c index 7fa5eb067d..af90f13c6f 100644 --- a/components/drivers/src/pipe.c +++ b/components/drivers/src/pipe.c @@ -16,7 +16,7 @@ #ifdef RT_USING_POSIX #include #include -#include +#include #include static int pipe_fops_open(struct dfs_fd *fd) diff --git a/components/libc/compilers/common/poll.h b/components/libc/compilers/common/poll.h index 1862373559..aea73d6eaf 100644 --- a/components/libc/compilers/common/poll.h +++ b/components/libc/compilers/common/poll.h @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-09-11 Meco Man First version + */ #ifndef __POLL_H__ #define __POLL_H__ diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c index 02915ab1cc..d9112eed3e 100644 --- a/components/lwp/lwp_syscall.c +++ b/components/lwp/lwp_syscall.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include #if (defined(RT_USING_SAL) && defined(SAL_USING_POSIX)) diff --git a/components/net/at/at_socket/at_socket.c b/components/net/at/at_socket/at_socket.c index 8215dd4417..96ea053f9c 100644 --- a/components/net/at/at_socket/at_socket.c +++ b/components/net/at/at_socket/at_socket.c @@ -19,7 +19,7 @@ #include #ifdef SAL_USING_POSIX -#include +#include #endif #include diff --git a/components/net/sal_socket/impl/af_inet_at.c b/components/net/sal_socket/impl/af_inet_at.c index c85dfe9f06..07dff0018c 100644 --- a/components/net/sal_socket/impl/af_inet_at.c +++ b/components/net/sal_socket/impl/af_inet_at.c @@ -19,7 +19,7 @@ #include #ifdef SAL_USING_POSIX -#include +#include #endif #ifdef SAL_USING_AT diff --git a/components/net/sal_socket/impl/af_inet_lwip.c b/components/net/sal_socket/impl/af_inet_lwip.c index 2e19275b5d..2cf0958ee4 100644 --- a/components/net/sal_socket/impl/af_inet_lwip.c +++ b/components/net/sal_socket/impl/af_inet_lwip.c @@ -17,7 +17,7 @@ #include #ifdef SAL_USING_POSIX -#include +#include #endif #include diff --git a/components/net/sal_socket/socket/net_sockets.c b/components/net/sal_socket/socket/net_sockets.c index 7d4db34327..1b6db50e6d 100644 --- a/components/net/sal_socket/socket/net_sockets.c +++ b/components/net/sal_socket/socket/net_sockets.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/components/utilities/rt-link/src/rtlink_dev.c b/components/utilities/rt-link/src/rtlink_dev.c index 5eff1f9782..efebf37565 100644 --- a/components/utilities/rt-link/src/rtlink_dev.c +++ b/components/utilities/rt-link/src/rtlink_dev.c @@ -21,7 +21,7 @@ #ifdef RT_USING_POSIX #include -#include +#include int rtlink_fops_open(struct dfs_fd *fd) { diff --git a/examples/rt-link/rtlink_dev_example.c b/examples/rt-link/rtlink_dev_example.c index 0a026bcb3d..d00f916efd 100644 --- a/examples/rt-link/rtlink_dev_example.c +++ b/examples/rt-link/rtlink_dev_example.c @@ -47,7 +47,7 @@ static rt_err_t rtlink_dev_tx_done(rt_device_t dev, void *buffer) #ifdef RT_USING_POSIX #include -#include +#include #include #define RTLINK01_PATH "/dev/rtlink01" -- cgit v1.3.1 From ee4b7916a35cff4c97103fe631a2eba7eccd69ac Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 22 Sep 2021 16:45:21 -0400 Subject: [libc标准化]脱敏dfs_select.h 由标准sys/select.h代替 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/src/dfs_select.c | 2 +- components/lwp/lwp_syscall.c | 2 +- components/net/sal_socket/SConscript | 3 --- .../sal_socket/include/dfs_net/sys_select/sys/select.h | 16 ---------------- examples/libc/termios_test.c | 2 +- examples/rt-link/rtlink_dev_example.c | 2 +- 6 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 components/net/sal_socket/include/dfs_net/sys_select/sys/select.h (limited to 'examples/rt-link/rtlink_dev_example.c') diff --git a/components/dfs/src/dfs_select.c b/components/dfs/src/dfs_select.c index ca9c549259..795b816354 100644 --- a/components/dfs/src/dfs_select.c +++ b/components/dfs/src/dfs_select.c @@ -12,7 +12,7 @@ #include #include -#include +#include #ifdef RT_USING_POSIX diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c index d9112eed3e..f9bc84ea97 100644 --- a/components/lwp/lwp_syscall.c +++ b/components/lwp/lwp_syscall.c @@ -14,7 +14,7 @@ #include #include -#include +#include #if (defined(RT_USING_SAL) && defined(SAL_USING_POSIX)) #include diff --git a/components/net/sal_socket/SConscript b/components/net/sal_socket/SConscript index cc7634f7d9..3903dce89a 100644 --- a/components/net/sal_socket/SConscript +++ b/components/net/sal_socket/SConscript @@ -26,9 +26,6 @@ if GetDepend('SAL_USING_POSIX'): CPPPATH += [cwd + '/include/dfs_net'] src += Glob('socket/net_sockets.c') src += Glob('dfs_net/*.c') - - if not GetDepend('HAVE_SYS_SELECT_H'): - CPPPATH += [cwd + '/include/dfs_net/sys_select'] if not GetDepend('HAVE_SYS_SOCKET_H'): CPPPATH += [cwd + '/include/socket/sys_socket'] diff --git a/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h b/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h deleted file mode 100644 index f174bc6504..0000000000 --- a/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2015-05-02 Bernard First version - */ - -#ifndef SELECT_H__ -#define SELECT_H__ - -#include - -#endif diff --git a/examples/libc/termios_test.c b/examples/libc/termios_test.c index f3a6ce3a1c..855bc82b96 100644 --- a/examples/libc/termios_test.c +++ b/examples/libc/termios_test.c @@ -16,7 +16,7 @@ #if defined (RT_USING_POSIX) #include - #include + #include #if defined (RT_USING_POSIX_TERMIOS) #include #else diff --git a/examples/rt-link/rtlink_dev_example.c b/examples/rt-link/rtlink_dev_example.c index d00f916efd..523b67ba53 100644 --- a/examples/rt-link/rtlink_dev_example.c +++ b/examples/rt-link/rtlink_dev_example.c @@ -48,7 +48,7 @@ static rt_err_t rtlink_dev_tx_done(rt_device_t dev, void *buffer) #ifdef RT_USING_POSIX #include #include -#include +#include #define RTLINK01_PATH "/dev/rtlink01" int fd = -1; -- cgit v1.3.1 From 7c789d4b11c13e45ab1d2a858c68dabb022eb07c Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 24 Nov 2021 09:14:46 -0500 Subject: revise some RT_USING_POSIX to RT_USING_POSIX_DEVIO --- components/dfs/filesystems/devfs/devfs.c | 4 ++-- components/drivers/serial/serial.c | 13 ++++++------- components/drivers/serial/serial_v2.c | 6 +++--- components/drivers/src/pipe.c | 10 +++++----- components/libc/compilers/common/sys/ioctl.h | 2 -- components/libc/posix/aio/SConscript | 2 +- components/libc/posix/src/libc.c | 9 ++++----- components/libc/posix/src/libc.h | 4 ++-- components/libc/posix/termios/SConscript | 4 +--- components/utilities/rt-link/src/rtlink_dev.c | 6 +++--- examples/libc/termios_test.c | 12 ------------ examples/rt-link/rtlink_dev_example.c | 4 ++-- include/rtdef.h | 2 +- src/device.c | 8 ++++---- 14 files changed, 34 insertions(+), 52 deletions(-) (limited to 'examples/rt-link/rtlink_dev_example.c') diff --git a/components/dfs/filesystems/devfs/devfs.c b/components/dfs/filesystems/devfs/devfs.c index d615482452..d60f7ddc9b 100644 --- a/components/dfs/filesystems/devfs/devfs.c +++ b/components/dfs/filesystems/devfs/devfs.c @@ -173,7 +173,7 @@ int dfs_device_fs_open(struct dfs_fd *file) if (device == RT_NULL) return -ENODEV; -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO if (device->fops) { /* use device fops */ @@ -192,7 +192,7 @@ int dfs_device_fs_open(struct dfs_fd *file) } } else -#endif +#endif /* RT_USING_POSIX_DEVIO */ { result = rt_device_open(device, RT_DEVICE_OFLAG_RDWR); if (result == RT_EOK || result == -RT_ENOSYS) diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 289d523bd2..c17c7aaebb 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -36,7 +36,7 @@ #define DBG_LVL DBG_INFO #include -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO #include #include #include @@ -203,7 +203,7 @@ const static struct dfs_file_ops _serial_fops = RT_NULL, /* getdents */ serial_fops_poll, }; -#endif +#endif /* RT_USING_POSIX_DEVIO */ /* * Serial poll routines @@ -976,8 +976,7 @@ static void _tc_flush(struct rt_serial_device *serial, int queue) } } - -#endif +#endif /* RT_USING_POSIX_TERMIOS */ static rt_err_t rt_serial_control(struct rt_device *dev, int cmd, @@ -1020,7 +1019,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev, } break; -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO #ifdef RT_USING_POSIX_TERMIOS case TCGETA: { @@ -1215,7 +1214,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev, *(rt_size_t *)args = recved; } break; -#endif /*RT_USING_POSIX*/ +#endif /* RT_USING_POSIX_DEVIO */ default : /* control device */ ret = serial->ops->control(serial, cmd, args); @@ -1270,7 +1269,7 @@ rt_err_t rt_hw_serial_register(struct rt_serial_device *serial, /* register a character device */ ret = rt_device_register(device, name, flag); -#if defined(RT_USING_POSIX) +#ifdef RT_USING_POSIX_DEVIO /* set fops */ device->fops = &_serial_fops; #endif diff --git a/components/drivers/serial/serial_v2.c b/components/drivers/serial/serial_v2.c index 390dd31748..4a43970126 100644 --- a/components/drivers/serial/serial_v2.c +++ b/components/drivers/serial/serial_v2.c @@ -16,7 +16,7 @@ #define DBG_LVL DBG_INFO #include -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO #include #include #include @@ -179,7 +179,7 @@ const static struct dfs_file_ops _serial_fops = RT_NULL, /* getdents */ serial_fops_poll, }; -#endif +#endif /* RT_USING_POSIX_DEVIO */ static rt_size_t rt_serial_get_linear_buffer(struct rt_ringbuffer *rb, rt_uint8_t **ptr) @@ -1135,7 +1135,7 @@ rt_err_t rt_hw_serial_register(struct rt_serial_device *serial, /* register a character device */ ret = rt_device_register(device, name, flag); -#if defined(RT_USING_POSIX) +#ifdef RT_USING_POSIX_DEVIO /* set fops */ device->fops = &_serial_fops; #endif diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c index bfb07fa950..1d803e9a4c 100644 --- a/components/drivers/src/pipe.c +++ b/components/drivers/src/pipe.c @@ -13,7 +13,7 @@ #include #include -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO #include #include #include @@ -320,7 +320,7 @@ static const struct dfs_file_ops pipe_fops = RT_NULL, pipe_fops_poll, }; -#endif /* end of RT_USING_POSIX */ +#endif /* RT_USING_POSIX_DEVIO */ rt_err_t rt_pipe_open(rt_device_t device, rt_uint16_t oflag) { @@ -479,7 +479,7 @@ rt_pipe_t *rt_pipe_create(const char *name, int bufsz) rt_free(pipe); return RT_NULL; } -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO dev->fops = (void*)&pipe_fops; #endif @@ -529,7 +529,7 @@ int rt_pipe_delete(const char *name) return result; } -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO int pipe(int fildes[2]) { rt_pipe_t *pipe; @@ -575,4 +575,4 @@ int mkfifo(const char *path, mode_t mode) return 0; } -#endif +#endif /* RT_USING_POSIX_DEVIO */ diff --git a/components/libc/compilers/common/sys/ioctl.h b/components/libc/compilers/common/sys/ioctl.h index 04f73837bc..29ed3a8b84 100644 --- a/components/libc/compilers/common/sys/ioctl.h +++ b/components/libc/compilers/common/sys/ioctl.h @@ -11,9 +11,7 @@ #define _SYS_IOCTL_H #include -#ifdef RT_USING_POSIX #include -#endif #ifdef _WIN32 #include diff --git a/components/libc/posix/aio/SConscript b/components/libc/posix/aio/SConscript index 445efaade5..139bc45749 100644 --- a/components/libc/posix/aio/SConscript +++ b/components/libc/posix/aio/SConscript @@ -6,6 +6,6 @@ cwd = GetCurrentDir() src = Glob('*.c') CPPPATH = [cwd] -group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX', 'RT_USING_POSIX_AIO'], CPPPATH = CPPPATH) +group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX_AIO'], CPPPATH = CPPPATH) Return('group') diff --git a/components/libc/posix/src/libc.c b/components/libc/posix/src/libc.c index 068719d5d6..c324d84ef8 100644 --- a/components/libc/posix/src/libc.c +++ b/components/libc/posix/src/libc.c @@ -23,7 +23,7 @@ int libc_system_init(void) { -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO rt_device_t dev_console; dev_console = rt_console_get_device(); @@ -31,7 +31,7 @@ int libc_system_init(void) { libc_stdio_set_console(dev_console->parent.name, O_RDWR); } -#endif /* RT_USING_POSIX */ +#endif /* RT_USING_POSIX_DEVIO */ #if defined RT_USING_PTHREADS && !defined RT_USING_COMPONENTS_INIT pthread_system_init(); @@ -41,8 +41,7 @@ int libc_system_init(void) } INIT_COMPONENT_EXPORT(libc_system_init); -#ifdef RT_USING_POSIX - +#ifdef RT_USING_POSIX_DEVIO #if defined(RT_USING_LIBC) && defined(RT_USING_NEWLIB) #define STDIO_DEVICE_NAME_MAX 32 static FILE* std_console = NULL; @@ -145,4 +144,4 @@ int libc_stdio_get_console(void) { return std_fd; } #endif /* defined(RT_USING_LIBC) && defined(RT_USING_NEWLIB) */ -#endif /* RT_USING_POSIX */ +#endif /* RT_USING_POSIX_DEVIO */ diff --git a/components/libc/posix/src/libc.h b/components/libc/posix/src/libc.h index f81380bf78..b019267926 100644 --- a/components/libc/posix/src/libc.h +++ b/components/libc/posix/src/libc.h @@ -17,10 +17,10 @@ extern "C" { #endif int libc_system_init(void); -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO int libc_stdio_get_console(void); int libc_stdio_set_console(const char* device_name, int mode); -#endif /* RT_USING_POSIX */ +#endif /* RT_USING_POSIX_DEVIO */ #ifdef __cplusplus } diff --git a/components/libc/posix/termios/SConscript b/components/libc/posix/termios/SConscript index bd9a528461..3615926251 100644 --- a/components/libc/posix/termios/SConscript +++ b/components/libc/posix/termios/SConscript @@ -6,8 +6,6 @@ cwd = GetCurrentDir() src = Glob('*.c') + Glob('*.cpp') CPPPATH = [cwd] -group = DefineGroup('POSIX', src, - depend = ['RT_USING_LIBC', 'RT_USING_POSIX', 'RT_USING_POSIX_TERMIOS'], - CPPPATH = CPPPATH) +group = DefineGroup('POSIX', src, depend = ['RT_USING_LIBC', 'RT_USING_POSIX_TERMIOS'], CPPPATH = CPPPATH) Return('group') diff --git a/components/utilities/rt-link/src/rtlink_dev.c b/components/utilities/rt-link/src/rtlink_dev.c index efebf37565..e91736251d 100644 --- a/components/utilities/rt-link/src/rtlink_dev.c +++ b/components/utilities/rt-link/src/rtlink_dev.c @@ -19,7 +19,7 @@ #define RTLINK_SERV(dev) (((struct rt_link_device*)dev)->service) -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO #include #include @@ -148,7 +148,7 @@ const static struct dfs_file_ops _rtlink_fops = RT_NULL, /* getdents */ rtlink_fops_poll, }; -#endif /* RT_USING_POSIX */ +#endif /* RT_USING_POSIX_DEVIO */ /* The event type for the service channel number, * which is used to wake up the service thread in blocking receive mode */ @@ -386,7 +386,7 @@ rt_err_t rt_link_dev_register(struct rt_link_device *rtlink, /* register a character device */ ret = rt_device_register(device, name, flag); -#if defined(RT_USING_POSIX) +#ifdef RT_USING_POSIX_DEVIO /* set fops */ device->fops = &_rtlink_fops; #endif diff --git a/examples/libc/termios_test.c b/examples/libc/termios_test.c index 855bc82b96..520fca6380 100644 --- a/examples/libc/termios_test.c +++ b/examples/libc/termios_test.c @@ -14,18 +14,6 @@ #include #include -#if defined (RT_USING_POSIX) - #include - #include - #if defined (RT_USING_POSIX_TERMIOS) - #include - #else - #error "TERMIOS need RT_USING_POSIX_TERMIOS" - #endif -#else - #error "POSIX poll/select need RT_USING_POSIX" -#endif - #define JOINT(x,y) x##y #define B(x) JOINT(B,x) #define Default_baud_rate 115200 diff --git a/examples/rt-link/rtlink_dev_example.c b/examples/rt-link/rtlink_dev_example.c index 523b67ba53..51b6432d9f 100644 --- a/examples/rt-link/rtlink_dev_example.c +++ b/examples/rt-link/rtlink_dev_example.c @@ -45,7 +45,7 @@ static rt_err_t rtlink_dev_tx_done(rt_device_t dev, void *buffer) return RT_EOK; } -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO #include #include #include @@ -205,7 +205,7 @@ static void rtlink_fselect() } } MSH_CMD_EXPORT(rtlink_fselect, rtlink posix interface example); -#endif /* RT_USING_POSIX */ +#endif /* RT_USING_POSIX_DEVIO */ static void rtlink_dread(void) { diff --git a/include/rtdef.h b/include/rtdef.h index 9975f8239f..74db37555a 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -1034,7 +1034,7 @@ struct rt_device rt_err_t (*control)(rt_device_t dev, int cmd, void *args); #endif -#if defined(RT_USING_POSIX) +#ifdef RT_USING_POSIX_DEVIO const struct dfs_file_ops *fops; struct rt_wqueue wait_queue; #endif diff --git a/src/device.c b/src/device.c index 6e22c2b692..ebb8f26854 100644 --- a/src/device.c +++ b/src/device.c @@ -16,9 +16,9 @@ */ #include -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO #include /* for wqueue_init */ -#endif /* RT_USING_POSIX */ +#endif /* RT_USING_POSIX_DEVIO */ #ifdef RT_USING_DEVICE @@ -64,10 +64,10 @@ rt_err_t rt_device_register(rt_device_t dev, dev->ref_count = 0; dev->open_flag = 0; -#ifdef RT_USING_POSIX +#ifdef RT_USING_POSIX_DEVIO dev->fops = RT_NULL; rt_wqueue_init(&(dev->wait_queue)); -#endif /* RT_USING_POSIX */ +#endif /* RT_USING_POSIX_DEVIO */ return RT_EOK; } -- cgit v1.3.1 From 3d2e23ec1c5140c8750c71ebf37c197f6048b94e Mon Sep 17 00:00:00 2001 From: liukangcc Date: Tue, 11 Jan 2022 15:20:14 +0800 Subject: [update] move dfs_posix.h to legacy/dfs/dfs_posix.h --- bsp/bluetrum/ab32vg1-ab-prougen/applications/mnt.c | 6 +++++- bsp/efm32/application.c | 10 ++++++++- bsp/ft2004/drivers/drv_sdcard.c | 6 +++++- bsp/lpc54114-lite/applications/mnt.c | 5 ++++- bsp/mini4020/applications/application.c | 6 +++++- bsp/nrf5x/nrf52832/applications/mnt.c | 6 +++++- bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c | 8 ++++++-- bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c | 8 ++++++-- bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c | 8 ++++++-- .../libraries/nu_packages/AudioCodec/audio_test.c | 6 +++++- bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c | 8 ++++++-- bsp/nuvoton/nk-980iot/applications/mnt.c | 8 ++++++-- bsp/nuvoton/nk-n9h30/applications/mnt.c | 8 ++++++-- bsp/nuvoton/nk-rtu980/applications/mnt.c | 8 ++++++-- bsp/nuvoton/numaker-iot-m487/applications/mnt.c | 8 ++++++-- bsp/nuvoton/numaker-m032ki/applications/mnt.c | 8 ++++++-- bsp/nuvoton/numaker-pfm-m487/applications/mnt.c | 8 ++++++-- bsp/simulator/drivers/module_win32.c | 6 +++++- .../board/ports/sdcard_port.c | 6 +++++- .../stm32f103-dofly-M3S/board/ports/drv_sdcard.c | 6 +++++- .../board/ports/sdcard_port.c | 6 +++++- .../stm32f407-armfly-v5/board/ports/sdcard_port.c | 6 +++++- .../board/ports/drv_filesystem.c | 6 +++++- .../board/ports/sdcard_port.c | 6 +++++- .../stm32f429-armfly-v6/board/ports/sdcard_port.c | 6 +++++- .../stm32f429-atk-apollo/board/ports/sdcard_port.c | 6 +++++- .../board/ports/sdcard_port.c | 6 +++++- .../stm32f469-st-disco/board/ports/drv_sdcard.c | 6 +++++- .../stm32f746-st-disco/board/ports/sdcard_port.c | 6 +++++- .../stm32f767-atk-apollo/board/ports/sdcard_port.c | 6 +++++- .../board/ports/sdcard_port.c | 6 +++++- .../stm32h743-atk-apollo/board/ports/drv_ov2640.c | 6 +++++- .../stm32l475-atk-pandora/board/ports/drv_sdcard.c | 6 +++++- .../board/ports/sdcard_port.c | 6 +++++- .../board/ports/audio/audio_play.c | 6 +++++- .../stm32mp157a-st-ev1/board/ports/drv_ov5640.c | 6 +++++- .../stm32mp157a-st-ev1/board/ports/drv_sound.c | 6 +++++- bsp/swm320-lq100/applications/main.c | 18 +++++++++++++--- bsp/swm320/applications/main.c | 18 +++++++++++++--- components/dfs/include/dfs_posix.h | 24 ---------------------- components/drivers/serial/serial.c | 5 ++++- components/drivers/serial/serial_v2.c | 4 +++- components/drivers/src/pipe.c | 5 +++-- components/finsh/msh.c | 5 ++++- components/finsh/msh_file.c | 5 ++++- components/finsh/shell.c | 4 +++- components/legacy/dfs/dfs_posix.h | 24 ++++++++++++++++++++++ components/libc/compilers/common/sys/ioctl.h | 4 +++- components/libc/libdl/dlmodule.c | 4 +++- components/libc/posix/io/aio/aio.c | 5 ++++- components/libc/posix/io/mman/mman.c | 4 +++- components/libc/posix/io/termios/termios.c | 4 +++- components/lwp/lwp.c | 5 ++++- components/lwp/lwp_syscall.h | 5 ++++- .../net/lwip-2.0.2/src/apps/tftp/tftp_port.c | 4 +++- .../net/lwip-2.0.3/src/apps/tftp/tftp_port.c | 4 +++- .../net/lwip-2.1.2/src/apps/tftp/tftp_port.c | 4 +++- components/net/sal_socket/impl/proto_mbedtls.c | 4 +++- components/utilities/rt-link/src/rtlink_dev.c | 4 +++- components/utilities/ymodem/ry_sy.c | 5 ++++- components/utilities/zmodem/rz.c | 5 +++-- components/utilities/zmodem/sz.c | 5 +++-- components/utilities/zmodem/zcore.c | 5 +++-- components/utilities/zmodem/zdevice.c | 5 +++-- examples/file/listdir.c | 6 +++++- examples/file/readspeed.c | 6 +++++- examples/file/readwrite.c | 6 +++++- examples/file/seekdir.c | 6 +++++- examples/file/writespeed.c | 6 +++++- examples/network/chargen.c | 6 +++++- examples/rt-link/rtlink_dev_example.c | 6 +++++- examples/test/fs_test.c | 6 +++++- examples/ymodem/tofile.c | 6 +++++- 73 files changed, 373 insertions(+), 114 deletions(-) delete mode 100644 components/dfs/include/dfs_posix.h create mode 100644 components/legacy/dfs/dfs_posix.h (limited to 'examples/rt-link/rtlink_dev_example.c') diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/applications/mnt.c b/bsp/bluetrum/ab32vg1-ab-prougen/applications/mnt.c index 50681e7bc6..317dd4c862 100644 --- a/bsp/bluetrum/ab32vg1-ab-prougen/applications/mnt.c +++ b/bsp/bluetrum/ab32vg1-ab-prougen/applications/mnt.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #include "drv_gpio.h" // #define DRV_DEBUG diff --git a/bsp/efm32/application.c b/bsp/efm32/application.c index 332dcc6ba8..5f2ad9866c 100644 --- a/bsp/efm32/application.c +++ b/bsp/efm32/application.c @@ -65,10 +65,18 @@ #include #include -#if defined(RTGUI_USING_DFS_FILERW) + #if defined(RTGUI_USING_DFS_FILERW) #include #define PATH_SEPARATOR '/' #endif +#if defined(RTGUI_USING_DFS_FILERW) +#include +#include +#include +#include +#include +#define PATH_SEPARATOR '/' +#endif #endif /* Private typedef -----------------------------------------------------------*/ diff --git a/bsp/ft2004/drivers/drv_sdcard.c b/bsp/ft2004/drivers/drv_sdcard.c index a6494089f6..753a70b606 100644 --- a/bsp/ft2004/drivers/drv_sdcard.c +++ b/bsp/ft2004/drivers/drv_sdcard.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #include "drv_sdctrl.h" #define DBG_TAG "app.card" diff --git a/bsp/lpc54114-lite/applications/mnt.c b/bsp/lpc54114-lite/applications/mnt.c index 49852b2025..f67c5c21ea 100644 --- a/bsp/lpc54114-lite/applications/mnt.c +++ b/bsp/lpc54114-lite/applications/mnt.c @@ -11,7 +11,10 @@ #if defined(RT_USING_DFS) #include -#include +#include +#include +#include +#include #endif #define BSP_FLASH_MOUNT_PATH "/mnt/flash" diff --git a/bsp/mini4020/applications/application.c b/bsp/mini4020/applications/application.c index f5a77d8c60..722443ac7c 100644 --- a/bsp/mini4020/applications/application.c +++ b/bsp/mini4020/applications/application.c @@ -22,7 +22,11 @@ #include #include #include -#include +#include +#include +#include +#include +#include #endif #ifdef RT_USING_RTGUI diff --git a/bsp/nrf5x/nrf52832/applications/mnt.c b/bsp/nrf5x/nrf52832/applications/mnt.c index c7e4d10235..d4af1d2b6c 100644 --- a/bsp/nrf5x/nrf52832/applications/mnt.c +++ b/bsp/nrf5x/nrf52832/applications/mnt.c @@ -35,7 +35,11 @@ #endif #include "fal.h" -#include +#include +#include +#include +#include +#include #define LOG_TAG "drv.fs" #define DBG_LVL DBG_LOG diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c index 708f653d36..38086cb2d5 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c @@ -20,8 +20,12 @@ #include #if defined(RT_USING_DFS) - #include - #include +#include +#include +#include +#include +#include +#include #endif /* Private define ---------------------------------------------------------------*/ diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c index 7c92743bd3..7c5aa68697 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c @@ -20,8 +20,12 @@ #include #if defined(RT_USING_DFS) - #include - #include +#include +#include +#include +#include +#include +#include #endif /* Private define ---------------------------------------------------------------*/ diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c index 499311c752..955fe6a645 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c @@ -20,8 +20,12 @@ #include #if defined(RT_USING_DFS) - #include - #include +#include +#include +#include +#include +#include +#include #endif /* Private define ---------------------------------------------------------------*/ diff --git a/bsp/nuvoton/libraries/nu_packages/AudioCodec/audio_test.c b/bsp/nuvoton/libraries/nu_packages/AudioCodec/audio_test.c index d978fa4ded..6a805b3ba7 100644 --- a/bsp/nuvoton/libraries/nu_packages/AudioCodec/audio_test.c +++ b/bsp/nuvoton/libraries/nu_packages/AudioCodec/audio_test.c @@ -16,7 +16,11 @@ #include "wavrecorder.h" #include "wavplayer.h" -#include "dfs_posix.h" +#include +#include +#include +#include +#include /* The routine just for test automatically. diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c index 6990ce215c..4b81a01f52 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c @@ -21,8 +21,12 @@ #include #if defined(RT_USING_DFS) - #include - #include +#include +#include +#include +#include +#include +#include #endif /* Private define ---------------------------------------------------------------*/ diff --git a/bsp/nuvoton/nk-980iot/applications/mnt.c b/bsp/nuvoton/nk-980iot/applications/mnt.c index 4ff5b1f252..803e4b751b 100644 --- a/bsp/nuvoton/nk-980iot/applications/mnt.c +++ b/bsp/nuvoton/nk-980iot/applications/mnt.c @@ -22,8 +22,12 @@ #include #if defined(RT_USING_DFS) - #include - #include +#include +#include +#include +#include +#include +#include #endif #if defined(PKG_USING_FAL) diff --git a/bsp/nuvoton/nk-n9h30/applications/mnt.c b/bsp/nuvoton/nk-n9h30/applications/mnt.c index 03e7481242..f4e7cf5bf3 100644 --- a/bsp/nuvoton/nk-n9h30/applications/mnt.c +++ b/bsp/nuvoton/nk-n9h30/applications/mnt.c @@ -22,8 +22,12 @@ #include #if defined(RT_USING_DFS) - #include - #include +#include +#include +#include +#include +#include +#include #endif #if defined(PKG_USING_FAL) diff --git a/bsp/nuvoton/nk-rtu980/applications/mnt.c b/bsp/nuvoton/nk-rtu980/applications/mnt.c index ecfc390243..f99fcb0134 100644 --- a/bsp/nuvoton/nk-rtu980/applications/mnt.c +++ b/bsp/nuvoton/nk-rtu980/applications/mnt.c @@ -22,8 +22,12 @@ #include #if defined(RT_USING_DFS) - #include - #include +#include +#include +#include +#include +#include +#include #endif #if defined(PKG_USING_FAL) diff --git a/bsp/nuvoton/numaker-iot-m487/applications/mnt.c b/bsp/nuvoton/numaker-iot-m487/applications/mnt.c index d7e657d852..c0cec18978 100644 --- a/bsp/nuvoton/numaker-iot-m487/applications/mnt.c +++ b/bsp/nuvoton/numaker-iot-m487/applications/mnt.c @@ -13,8 +13,12 @@ #include #if defined(RT_USING_DFS) - #include - #include +#include +#include +#include +#include +#include +#include #endif #if defined(PKG_USING_FAL) diff --git a/bsp/nuvoton/numaker-m032ki/applications/mnt.c b/bsp/nuvoton/numaker-m032ki/applications/mnt.c index 914fa657f6..00f0f91499 100644 --- a/bsp/nuvoton/numaker-m032ki/applications/mnt.c +++ b/bsp/nuvoton/numaker-m032ki/applications/mnt.c @@ -13,8 +13,12 @@ #include #if defined(RT_USING_DFS) - #include - #include +#include +#include +#include +#include +#include +#include #endif #if defined(PKG_USING_FAL) diff --git a/bsp/nuvoton/numaker-pfm-m487/applications/mnt.c b/bsp/nuvoton/numaker-pfm-m487/applications/mnt.c index 6e7a9ff5de..844ab9960d 100644 --- a/bsp/nuvoton/numaker-pfm-m487/applications/mnt.c +++ b/bsp/nuvoton/numaker-pfm-m487/applications/mnt.c @@ -13,8 +13,12 @@ #include #if defined(RT_USING_DFS) - #include - #include +#include +#include +#include +#include +#include +#include #endif #if defined(PKG_USING_FAL) diff --git a/bsp/simulator/drivers/module_win32.c b/bsp/simulator/drivers/module_win32.c index 81a98eca87..0f07576964 100644 --- a/bsp/simulator/drivers/module_win32.c +++ b/bsp/simulator/drivers/module_win32.c @@ -193,7 +193,11 @@ RTM_EXPORT(rt_module_find); #ifdef RT_USING_DFS #include -#include +#include +#include +#include +#include +#include extern char * dfs_win32_dirdup(char * path); static char* _module_name(const char *path) { diff --git a/bsp/stm32/stm32f103-atk-warshipv3/board/ports/sdcard_port.c b/bsp/stm32/stm32f103-atk-warshipv3/board/ports/sdcard_port.c index d56fb039d4..df2614c080 100644 --- a/bsp/stm32/stm32f103-atk-warshipv3/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f103-atk-warshipv3/board/ports/sdcard_port.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #define DBG_TAG "app.card" #define DBG_LVL DBG_INFO diff --git a/bsp/stm32/stm32f103-dofly-M3S/board/ports/drv_sdcard.c b/bsp/stm32/stm32f103-dofly-M3S/board/ports/drv_sdcard.c index 13d235b694..d717da27dd 100644 --- a/bsp/stm32/stm32f103-dofly-M3S/board/ports/drv_sdcard.c +++ b/bsp/stm32/stm32f103-dofly-M3S/board/ports/drv_sdcard.c @@ -14,7 +14,11 @@ #if defined BSP_USING_SDIO_SDCARD || defined BSP_USING_SPI_SDCARD #include #include -#include +#include +#include +#include +#include +#include #include "drv_gpio.h" #define DBG_TAG "app.card" diff --git a/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c b/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c index 55baa2c263..c0575f01b2 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f103-fire-arbitrary/board/ports/sdcard_port.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #define DBG_TAG "app.card" #define DBG_LVL DBG_INFO diff --git a/bsp/stm32/stm32f407-armfly-v5/board/ports/sdcard_port.c b/bsp/stm32/stm32f407-armfly-v5/board/ports/sdcard_port.c index f5427ef265..2b6e48ba3f 100644 --- a/bsp/stm32/stm32f407-armfly-v5/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f407-armfly-v5/board/ports/sdcard_port.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #define DBG_TAG "app.card" #define DBG_LVL DBG_INFO diff --git a/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c b/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c index 6635c43128..cafb45b107 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c +++ b/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c @@ -15,7 +15,11 @@ #ifdef BSP_USING_FS #include #include -#include +#include +#include +#include +#include +#include #if DFS_FILESYSTEMS_MAX < 4 #error "Please define DFS_FILESYSTEMS_MAX more than 4" diff --git a/bsp/stm32/stm32f427-robomaster-a/board/ports/sdcard_port.c b/bsp/stm32/stm32f427-robomaster-a/board/ports/sdcard_port.c index 6a79c83523..376089ef9e 100644 --- a/bsp/stm32/stm32f427-robomaster-a/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f427-robomaster-a/board/ports/sdcard_port.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #define DBG_TAG "app.card" #define DBG_LVL DBG_INFO diff --git a/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c b/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c index 6a79c83523..376089ef9e 100644 --- a/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f429-armfly-v6/board/ports/sdcard_port.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #define DBG_TAG "app.card" #define DBG_LVL DBG_INFO diff --git a/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c b/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c index fe2595fa4b..058a948a8a 100644 --- a/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f429-atk-apollo/board/ports/sdcard_port.c @@ -15,7 +15,11 @@ #include #include -#include +#include +#include +#include +#include +#include #define DBG_TAG "app.card" #define DBG_LVL DBG_INFO diff --git a/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c b/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c index 01111ab4d3..93702aed13 100644 --- a/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f429-fire-challenger/board/ports/sdcard_port.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #include "drv_gpio.h" #define DBG_TAG "app.card" diff --git a/bsp/stm32/stm32f469-st-disco/board/ports/drv_sdcard.c b/bsp/stm32/stm32f469-st-disco/board/ports/drv_sdcard.c index 9fd2d11fd4..986a562cdd 100644 --- a/bsp/stm32/stm32f469-st-disco/board/ports/drv_sdcard.c +++ b/bsp/stm32/stm32f469-st-disco/board/ports/drv_sdcard.c @@ -15,7 +15,11 @@ #include #include -#include +#include +#include +#include +#include +#include #include "drv_gpio.h" #include "drv_sdio.h" diff --git a/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c b/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c index 66e8dfefab..bcb8a33308 100644 --- a/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f746-st-disco/board/ports/sdcard_port.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #define DBG_TAG "app.card" #define DBG_LVL DBG_INFO diff --git a/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c b/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c index bc7e8b676e..9180edcc7e 100644 --- a/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f767-atk-apollo/board/ports/sdcard_port.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #define DBG_TAG "app.card" #define DBG_LVL DBG_INFO diff --git a/bsp/stm32/stm32f767-fire-challenger-v1/board/ports/sdcard_port.c b/bsp/stm32/stm32f767-fire-challenger-v1/board/ports/sdcard_port.c index f1a7b8c27f..edbb295da5 100644 --- a/bsp/stm32/stm32f767-fire-challenger-v1/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32f767-fire-challenger-v1/board/ports/sdcard_port.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #include "drv_gpio.h" #define DBG_TAG "app.card" diff --git a/bsp/stm32/stm32h743-atk-apollo/board/ports/drv_ov2640.c b/bsp/stm32/stm32h743-atk-apollo/board/ports/drv_ov2640.c index 95e5784654..83058e352c 100644 --- a/bsp/stm32/stm32h743-atk-apollo/board/ports/drv_ov2640.c +++ b/bsp/stm32/stm32h743-atk-apollo/board/ports/drv_ov2640.c @@ -12,7 +12,11 @@ #if defined(BSP_USING_OV2640) -#include +#include +#include +#include +#include +#include #include #include #include "pcf8574.h" diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_sdcard.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_sdcard.c index 2bed0ef415..ba253aacfa 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_sdcard.c +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_sdcard.c @@ -15,7 +15,11 @@ #include #include -#include +#include +#include +#include +#include +#include #include "drv_spi.h" #include "spi_msd.h" diff --git a/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c b/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c index 6abc52c3ba..3016f583d3 100644 --- a/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c +++ b/bsp/stm32/stm32l496-ali-developer/board/ports/sdcard_port.c @@ -14,7 +14,11 @@ #include #include -#include +#include +#include +#include +#include +#include #define DBG_TAG "app.card" #define DBG_LVL DBG_INFO diff --git a/bsp/stm32/stm32mp157a-st-discovery/board/ports/audio/audio_play.c b/bsp/stm32/stm32mp157a-st-discovery/board/ports/audio/audio_play.c index 2e045b016b..1f463d99bf 100644 --- a/bsp/stm32/stm32mp157a-st-discovery/board/ports/audio/audio_play.c +++ b/bsp/stm32/stm32mp157a-st-discovery/board/ports/audio/audio_play.c @@ -10,7 +10,11 @@ #include #include -#include +#include +#include +#include +#include +#include #if defined(BSP_USING_AUDIO) && defined(BSP_USING_SDMMC) #define BUFSZ 1024 diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_ov5640.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_ov5640.c index 69af85e27b..303a78fc1d 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_ov5640.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_ov5640.c @@ -13,7 +13,11 @@ #if defined(BSP_USING_DCMI) #include "drv_mfx.h" -#include +#include +#include +#include +#include +#include #include "drv_ov5640.h" //#define DRV_DEBUG diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_sound.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_sound.c index b9e76a0703..93acea9c1d 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_sound.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_sound.c @@ -13,7 +13,11 @@ #ifdef BSP_USING_AUDIO #include "drv_wm8994.h" -#include +#include +#include +#include +#include +#include #define DRV_DEBUG #define LOG_TAG "drv.sound" diff --git a/bsp/swm320-lq100/applications/main.c b/bsp/swm320-lq100/applications/main.c index 5685bf6745..ecc86347c2 100644 --- a/bsp/swm320-lq100/applications/main.c +++ b/bsp/swm320-lq100/applications/main.c @@ -260,7 +260,11 @@ MSH_CMD_EXPORT(wdt_sample, wdt sample); #include "drv_spi.h" #include "spi_flash_sfud.h" -#include "dfs_posix.h" +#include +#include +#include +#include +#include static int rt_hw_spi_flash_init(void) { @@ -380,7 +384,11 @@ MSH_CMD_EXPORT(spi_w25q_sample, spi w25q sample); //#define SDCARD_NAME "sd0" //#include "drv_spi.h" -//#include "dfs_posix.h" +// #include +// #include +// #include +// #include +// #include //#include "spi_msd.h" //static int rt_hw_spi1_tfcard(void) @@ -437,7 +445,11 @@ MSH_CMD_EXPORT(spi_w25q_sample, spi w25q sample); #ifdef RT_USING_SDIO #define SDCARD_NAME "sd0" -#include "dfs_posix.h" +#include +#include +#include +#include +#include static void sdio_elmfat_sample(void) { diff --git a/bsp/swm320/applications/main.c b/bsp/swm320/applications/main.c index 0ebd6663f6..f34a421727 100644 --- a/bsp/swm320/applications/main.c +++ b/bsp/swm320/applications/main.c @@ -260,7 +260,11 @@ MSH_CMD_EXPORT(wdt_sample, wdt sample); #include "drv_spi.h" #include "spi_flash_sfud.h" -#include "dfs_posix.h" +#include +#include +#include +#include +#include static int rt_hw_spi_flash_init(void) { @@ -380,7 +384,11 @@ MSH_CMD_EXPORT(spi_w25q_sample, spi w25q sample); //#define SDCARD_NAME "sd0" //#include "drv_spi.h" -//#include "dfs_posix.h" +// #include +// #include +// #include +// #include +// #include //#include "spi_msd.h" //static int rt_hw_spi1_tfcard(void) @@ -437,7 +445,11 @@ MSH_CMD_EXPORT(spi_w25q_sample, spi w25q sample); #ifdef RT_USING_SDIO #define SDCARD_NAME "sd0" -#include "dfs_posix.h" +#include +#include +#include +#include +#include static void sdio_elmfat_sample(void) { diff --git a/components/dfs/include/dfs_posix.h b/components/dfs/include/dfs_posix.h deleted file mode 100644 index ee62cdde82..0000000000 --- a/components/dfs/include/dfs_posix.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2009-05-27 Yi.qiu The first version. - * 2010-07-18 Bernard add stat and statfs structure definitions. - * 2011-05-16 Yi.qiu Change parameter name of rename, "new" is C++ key word. - * 2017-12-27 Bernard Add fcntl API. - * 2018-02-07 Bernard Change the 3rd parameter of open/fcntl/ioctl to '...' - */ - -#ifndef __DFS_POSIX_H__ -#define __DFS_POSIX_H__ - -#include -#include -#include /* rename() */ -#include -#include /* statfs() */ - -#endif diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index da330b5e9c..7182e23c37 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -37,7 +37,10 @@ #include #ifdef RT_USING_POSIX_STDIO -#include +#include +#include +#include +#include #include #include diff --git a/components/drivers/serial/serial_v2.c b/components/drivers/serial/serial_v2.c index 16d376eeb9..738afcb081 100644 --- a/components/drivers/serial/serial_v2.c +++ b/components/drivers/serial/serial_v2.c @@ -17,7 +17,9 @@ #include #ifdef RT_USING_POSIX_STDIO -#include +#include +#include +#include #include #include diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c index 7e1f569b62..2bc0a10083 100644 --- a/components/drivers/src/pipe.c +++ b/components/drivers/src/pipe.c @@ -14,8 +14,9 @@ #include #if defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_POSIX_PIPE) -#include -#include +#include +#include +#include #include #include diff --git a/components/finsh/msh.c b/components/finsh/msh.c index acb5445ad1..abf82e992c 100644 --- a/components/finsh/msh.c +++ b/components/finsh/msh.c @@ -21,7 +21,10 @@ #include "msh.h" #include "shell.h" #ifdef DFS_USING_POSIX -#include +#include +#include +#include +#include #endif /* DFS_USING_POSIX */ #ifdef RT_USING_MODULE #include diff --git a/components/finsh/msh_file.c b/components/finsh/msh_file.c index 8022b176fc..28f8d4803f 100644 --- a/components/finsh/msh_file.c +++ b/components/finsh/msh_file.c @@ -15,7 +15,10 @@ #include #include "msh.h" -#include +#include +#include +#include +#include static int msh_readline(int fd, char *line_buf, int size) { diff --git a/components/finsh/shell.c b/components/finsh/shell.c index 5398db5370..a326ba1978 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -28,7 +28,9 @@ #include "msh.h" #ifdef DFS_USING_POSIX -#include +#include +#include +#include #endif /* DFS_USING_POSIX */ /* finsh thread */ diff --git a/components/legacy/dfs/dfs_posix.h b/components/legacy/dfs/dfs_posix.h new file mode 100644 index 0000000000..ee62cdde82 --- /dev/null +++ b/components/legacy/dfs/dfs_posix.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2009-05-27 Yi.qiu The first version. + * 2010-07-18 Bernard add stat and statfs structure definitions. + * 2011-05-16 Yi.qiu Change parameter name of rename, "new" is C++ key word. + * 2017-12-27 Bernard Add fcntl API. + * 2018-02-07 Bernard Change the 3rd parameter of open/fcntl/ioctl to '...' + */ + +#ifndef __DFS_POSIX_H__ +#define __DFS_POSIX_H__ + +#include +#include +#include /* rename() */ +#include +#include /* statfs() */ + +#endif diff --git a/components/libc/compilers/common/sys/ioctl.h b/components/libc/compilers/common/sys/ioctl.h index d93c79115a..49c294eb8d 100644 --- a/components/libc/compilers/common/sys/ioctl.h +++ b/components/libc/compilers/common/sys/ioctl.h @@ -12,7 +12,9 @@ #define __SYS_IOCTL_H__ #include -#include +#include +#include +#include #ifdef _WIN32 #include diff --git a/components/libc/libdl/dlmodule.c b/components/libc/libdl/dlmodule.c index 044c05a994..32d6b6b7e7 100644 --- a/components/libc/libdl/dlmodule.c +++ b/components/libc/libdl/dlmodule.c @@ -15,7 +15,9 @@ #include "dlelf.h" #if defined(RT_USING_POSIX) -#include +#include +#include +#include #endif #define DBG_TAG "DLMD" diff --git a/components/libc/posix/io/aio/aio.c b/components/libc/posix/io/aio/aio.c index 08ef4c634a..bf188728f0 100644 --- a/components/libc/posix/io/aio/aio.c +++ b/components/libc/posix/io/aio/aio.c @@ -10,7 +10,10 @@ #include #include -#include +#include +#include +#include +#include #include "aio.h" struct rt_workqueue* aio_queue = NULL; diff --git a/components/libc/posix/io/mman/mman.c b/components/libc/posix/io/mman/mman.c index 827f2cbb14..d484b3ed7b 100644 --- a/components/libc/posix/io/mman/mman.c +++ b/components/libc/posix/io/mman/mman.c @@ -12,7 +12,9 @@ #include #include -#include +#include +#include +#include #include "sys/mman.h" diff --git a/components/libc/posix/io/termios/termios.c b/components/libc/posix/io/termios/termios.c index 44e0e80853..14d85e9f0c 100644 --- a/components/libc/posix/io/termios/termios.c +++ b/components/libc/posix/io/termios/termios.c @@ -10,7 +10,9 @@ #include #include -#include +#include +#include +#include #include #include "termios.h" diff --git a/components/lwp/lwp.c b/components/lwp/lwp.c index 9789595ee7..4b91538b68 100644 --- a/components/lwp/lwp.c +++ b/components/lwp/lwp.c @@ -11,7 +11,10 @@ #include #include -#include +#include +#include +#include +#include #ifndef RT_USING_DFS #error "lwp need file system(RT_USING_DFS)" diff --git a/components/lwp/lwp_syscall.h b/components/lwp/lwp_syscall.h index 02599f4317..749406c1ca 100644 --- a/components/lwp/lwp_syscall.h +++ b/components/lwp/lwp_syscall.h @@ -13,7 +13,10 @@ #include #include -#include +#include +#include +#include +#include #include #include #include diff --git a/components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c b/components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c index 59e64c7a3b..38221ac580 100644 --- a/components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c +++ b/components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c @@ -10,7 +10,9 @@ #include -#include +#include +#include +#include #include static struct tftp_context ctx; diff --git a/components/net/lwip-2.0.3/src/apps/tftp/tftp_port.c b/components/net/lwip-2.0.3/src/apps/tftp/tftp_port.c index 59e64c7a3b..38221ac580 100644 --- a/components/net/lwip-2.0.3/src/apps/tftp/tftp_port.c +++ b/components/net/lwip-2.0.3/src/apps/tftp/tftp_port.c @@ -10,7 +10,9 @@ #include -#include +#include +#include +#include #include static struct tftp_context ctx; diff --git a/components/net/lwip-2.1.2/src/apps/tftp/tftp_port.c b/components/net/lwip-2.1.2/src/apps/tftp/tftp_port.c index 59e64c7a3b..38221ac580 100644 --- a/components/net/lwip-2.1.2/src/apps/tftp/tftp_port.c +++ b/components/net/lwip-2.1.2/src/apps/tftp/tftp_port.c @@ -10,7 +10,9 @@ #include -#include +#include +#include +#include #include static struct tftp_context ctx; diff --git a/components/net/sal_socket/impl/proto_mbedtls.c b/components/net/sal_socket/impl/proto_mbedtls.c index 79fbdcc5d4..338792c948 100644 --- a/components/net/sal_socket/impl/proto_mbedtls.c +++ b/components/net/sal_socket/impl/proto_mbedtls.c @@ -11,7 +11,9 @@ #include #ifdef RT_USING_DFS -#include +#include +#include +#include #endif #ifdef SAL_USING_TLS diff --git a/components/utilities/rt-link/src/rtlink_dev.c b/components/utilities/rt-link/src/rtlink_dev.c index e91736251d..702aed32da 100644 --- a/components/utilities/rt-link/src/rtlink_dev.c +++ b/components/utilities/rt-link/src/rtlink_dev.c @@ -20,7 +20,9 @@ #define RTLINK_SERV(dev) (((struct rt_link_device*)dev)->service) #ifdef RT_USING_POSIX_DEVIO -#include +#include +#include +#include #include int rtlink_fops_open(struct dfs_fd *fd) diff --git a/components/utilities/ymodem/ry_sy.c b/components/utilities/ymodem/ry_sy.c index 3f3b022d7e..b77bd7abc2 100644 --- a/components/utilities/ymodem/ry_sy.c +++ b/components/utilities/ymodem/ry_sy.c @@ -11,7 +11,10 @@ #include #include -#include +#include +#include +#include +#include #include #include diff --git a/components/utilities/zmodem/rz.c b/components/utilities/zmodem/rz.c index 224d8f95a8..f4fa4bde6c 100644 --- a/components/utilities/zmodem/rz.c +++ b/components/utilities/zmodem/rz.c @@ -13,8 +13,9 @@ #include #include #include -#include -#include +#include +#include +#include #include #include "zdef.h" diff --git a/components/utilities/zmodem/sz.c b/components/utilities/zmodem/sz.c index e6096756b1..bda5d939d4 100644 --- a/components/utilities/zmodem/sz.c +++ b/components/utilities/zmodem/sz.c @@ -12,8 +12,9 @@ #include #include #include -#include -#include +#include +#include +#include #include "zdef.h" diff --git a/components/utilities/zmodem/zcore.c b/components/utilities/zmodem/zcore.c index 75d9647348..b4e23b585a 100644 --- a/components/utilities/zmodem/zcore.c +++ b/components/utilities/zmodem/zcore.c @@ -11,8 +11,9 @@ #include #include #include -#include -#include +#include +#include +#include #include #include "zdef.h" diff --git a/components/utilities/zmodem/zdevice.c b/components/utilities/zmodem/zdevice.c index 3a144e79de..980a15f4f8 100644 --- a/components/utilities/zmodem/zdevice.c +++ b/components/utilities/zmodem/zdevice.c @@ -11,8 +11,9 @@ #include #include #include -#include -#include +#include +#include +#include #include "zdef.h" diff --git a/examples/file/listdir.c b/examples/file/listdir.c index 9649347734..d858a00bff 100644 --- a/examples/file/listdir.c +++ b/examples/file/listdir.c @@ -9,7 +9,11 @@ * 2020-04-12 Jianjia Ma add msh cmd */ #include -#include +#include +#include +#include +#include +#include void list_dir(const char* path) { diff --git a/examples/file/readspeed.c b/examples/file/readspeed.c index 5f4cad3190..dfa68ceb32 100644 --- a/examples/file/readspeed.c +++ b/examples/file/readspeed.c @@ -10,7 +10,11 @@ */ #include -#include +#include +#include +#include +#include +#include void readspeed(const char* filename, int block_size) { diff --git a/examples/file/readwrite.c b/examples/file/readwrite.c index d1dd5bc038..5d0defeaa9 100644 --- a/examples/file/readwrite.c +++ b/examples/file/readwrite.c @@ -10,7 +10,11 @@ */ #include -#include +#include +#include +#include +#include +#include #define TEST_DATA_LEN 120 diff --git a/examples/file/seekdir.c b/examples/file/seekdir.c index efadd3a1c8..5198a8056b 100644 --- a/examples/file/seekdir.c +++ b/examples/file/seekdir.c @@ -8,7 +8,11 @@ * 2011-06-02 Bernard first version * 2020-04-12 Jianjia Ma add msh cmd */ -#include +#include +#include +#include +#include +#include void seekdir_test(void) { diff --git a/examples/file/writespeed.c b/examples/file/writespeed.c index f76027d28b..87a4c329bd 100644 --- a/examples/file/writespeed.c +++ b/examples/file/writespeed.c @@ -9,7 +9,11 @@ * 2020-04-12 Jianjia Ma add msh cmd */ #include -#include +#include +#include +#include +#include +#include void writespeed(const char* filename, int total_length, int block_size) { diff --git a/examples/network/chargen.c b/examples/network/chargen.c index 3b4feaca9e..69a6b13a5d 100644 --- a/examples/network/chargen.c +++ b/examples/network/chargen.c @@ -12,7 +12,11 @@ #ifdef SAL_USING_POSIX #include // only dfs_net -#include +#include +#include +#include +#include +#include #else #define read lwip_read #define write lwip_write diff --git a/examples/rt-link/rtlink_dev_example.c b/examples/rt-link/rtlink_dev_example.c index 51b6432d9f..027292769d 100644 --- a/examples/rt-link/rtlink_dev_example.c +++ b/examples/rt-link/rtlink_dev_example.c @@ -46,7 +46,11 @@ static rt_err_t rtlink_dev_tx_done(rt_device_t dev, void *buffer) } #ifdef RT_USING_POSIX_DEVIO -#include +#include +#include +#include +#include +#include #include #include diff --git a/examples/test/fs_test.c b/examples/test/fs_test.c index a86bbd6ac2..7fd70284cf 100644 --- a/examples/test/fs_test.c +++ b/examples/test/fs_test.c @@ -11,7 +11,11 @@ */ #include -#include +#include +#include +#include +#include +#include static rt_uint32_t stop_flag = 0; static rt_thread_t fsrw1_thread = RT_NULL; diff --git a/examples/ymodem/tofile.c b/examples/ymodem/tofile.c index 35dca2f2c1..8fb2d0c06b 100644 --- a/examples/ymodem/tofile.c +++ b/examples/ymodem/tofile.c @@ -9,7 +9,11 @@ #include #include -#include +#include +#include +#include +#include +#include #include #include -- cgit v1.3.1