From 43eb58da996b8b39a138cfc55b64c5854d8edeb7 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Tue, 2 Jul 2019 17:14:58 +0200 Subject: [PATCH] VFS: Fix Kconfig prefix --- components/newlib/platform_include/sys/termios.h | 4 ++-- components/newlib/select.c | 4 ++-- components/newlib/termios.c | 4 ++-- components/vfs/Kconfig | 4 ++-- components/vfs/include/esp_vfs.h | 4 ++-- components/vfs/sdkconfig.rename | 5 +++++ components/vfs/test/test_vfs_uart.c | 4 ++-- components/vfs/vfs.c | 8 ++++---- components/vfs/vfs_uart.c | 8 ++++---- 9 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 components/vfs/sdkconfig.rename diff --git a/components/newlib/platform_include/sys/termios.h b/components/newlib/platform_include/sys/termios.h index fd0eb5ca88..c27e107be3 100644 --- a/components/newlib/platform_include/sys/termios.h +++ b/components/newlib/platform_include/sys/termios.h @@ -27,7 +27,7 @@ #include #include "sdkconfig.h" -#ifdef CONFIG_SUPPORT_TERMIOS +#ifdef CONFIG_VFS_SUPPORT_TERMIOS // subscripts for the array c_cc: #define VEOF 0 /** EOF character */ @@ -291,6 +291,6 @@ int tcsetattr(int fd, int optional_actions, const struct termios *p); } // extern "C" #endif -#endif // CONFIG_SUPPORT_TERMIOS +#endif // CONFIG_VFS_SUPPORT_TERMIOS #endif //__ESP_SYS_TERMIOS_H__ diff --git a/components/newlib/select.c b/components/newlib/select.c index 38b2523913..a8e68e72b2 100644 --- a/components/newlib/select.c +++ b/components/newlib/select.c @@ -19,9 +19,9 @@ #ifdef CONFIG_LWIP_USE_ONLY_LWIP_SELECT #include "lwip/sockets.h" -#ifdef CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT +#ifdef CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT #define LOG_LOCAL_LEVEL ESP_LOG_NONE -#endif //CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT +#endif //CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT #include "esp_log.h" static const char *TAG = "newlib_select"; diff --git a/components/newlib/termios.c b/components/newlib/termios.c index bccd5bf839..cb0c94b9bb 100644 --- a/components/newlib/termios.c +++ b/components/newlib/termios.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_SUPPORT_TERMIOS +#ifdef CONFIG_VFS_SUPPORT_TERMIOS #include #include @@ -51,4 +51,4 @@ int cfsetospeed(struct termios *p, speed_t sp) } } -#endif // CONFIG_SUPPORT_TERMIOS +#endif // CONFIG_VFS_SUPPORT_TERMIOS diff --git a/components/vfs/Kconfig b/components/vfs/Kconfig index b34679b20e..c18397bdcb 100644 --- a/components/vfs/Kconfig +++ b/components/vfs/Kconfig @@ -1,6 +1,6 @@ menu "Virtual file system" - config SUPPRESS_SELECT_DEBUG_OUTPUT + config VFS_SUPPRESS_SELECT_DEBUG_OUTPUT bool "Suppress select() related debug outputs" default y help @@ -9,7 +9,7 @@ menu "Virtual file system" It is possible to suppress these debug outputs by enabling this option. - config SUPPORT_TERMIOS + config VFS_SUPPORT_TERMIOS bool "Add support for termios.h" default y help diff --git a/components/vfs/include/esp_vfs.h b/components/vfs/include/esp_vfs.h index 1d8abd8b35..3e711f2540 100644 --- a/components/vfs/include/esp_vfs.h +++ b/components/vfs/include/esp_vfs.h @@ -196,7 +196,7 @@ typedef struct int (*utime_p)(void* ctx, const char *path, const struct utimbuf *times); int (*utime)(const char *path, const struct utimbuf *times); }; -#ifdef CONFIG_SUPPORT_TERMIOS +#ifdef CONFIG_VFS_SUPPORT_TERMIOS union { int (*tcsetattr_p)(void *ctx, int fd, int optional_actions, const struct termios *p); int (*tcsetattr)(int fd, int optional_actions, const struct termios *p); @@ -225,7 +225,7 @@ typedef struct int (*tcsendbreak_p)(void *ctx, int fd, int duration); int (*tcsendbreak)(int fd, int duration); }; -#endif // CONFIG_SUPPORT_TERMIOS +#endif // CONFIG_VFS_SUPPORT_TERMIOS /** start_select is called for setting up synchronous I/O multiplexing of the desired file descriptors in the given VFS */ esp_err_t (*start_select)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, esp_vfs_select_sem_t sem); diff --git a/components/vfs/sdkconfig.rename b/components/vfs/sdkconfig.rename new file mode 100644 index 0000000000..92fb091ffc --- /dev/null +++ b/components/vfs/sdkconfig.rename @@ -0,0 +1,5 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT +CONFIG_SUPPORT_TERMIOS CONFIG_VFS_SUPPORT_TERMIOS diff --git a/components/vfs/test/test_vfs_uart.c b/components/vfs/test/test_vfs_uart.c index d46c7cb757..5c3d3f1d60 100644 --- a/components/vfs/test/test_vfs_uart.c +++ b/components/vfs/test/test_vfs_uart.c @@ -202,7 +202,7 @@ TEST_CASE("can write to UART while another task is reading", "[vfs]") vSemaphoreDelete(write_arg.done); } -#ifdef CONFIG_SUPPORT_TERMIOS +#ifdef CONFIG_VFS_SUPPORT_TERMIOS TEST_CASE("Can use termios for UART", "[vfs]") { uart_config_t uart_config = { @@ -328,4 +328,4 @@ TEST_CASE("Can use termios for UART", "[vfs]") close(uart_fd); uart_driver_delete(UART_NUM_1); } -#endif // CONFIG_SUPPORT_TERMIOS +#endif // CONFIG_VFS_SUPPORT_TERMIOS diff --git a/components/vfs/vfs.c b/components/vfs/vfs.c index 19f081c5a3..ecbaf6acf1 100644 --- a/components/vfs/vfs.c +++ b/components/vfs/vfs.c @@ -27,9 +27,9 @@ #include "esp_vfs.h" #include "sdkconfig.h" -#ifdef CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT +#ifdef CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT #define LOG_LOCAL_LEVEL ESP_LOG_NONE -#endif //CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT +#endif //CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT #include "esp_log.h" static const char *TAG = "vfs"; @@ -1032,7 +1032,7 @@ void esp_vfs_select_triggered_isr(esp_vfs_select_sem_t sem, BaseType_t *woken) } } -#ifdef CONFIG_SUPPORT_TERMIOS +#ifdef CONFIG_VFS_SUPPORT_TERMIOS int tcgetattr(int fd, struct termios *p) { const vfs_entry_t* vfs = get_vfs_for_fd(fd); @@ -1130,7 +1130,7 @@ int tcsendbreak(int fd, int duration) CHECK_AND_CALL(ret, r, vfs, tcsendbreak, local_fd, duration); return ret; } -#endif // CONFIG_SUPPORT_TERMIOS +#endif // CONFIG_VFS_SUPPORT_TERMIOS int esp_vfs_utime(const char *path, const struct utimbuf *times) { diff --git a/components/vfs/vfs_uart.c b/components/vfs/vfs_uart.c index 2bb865b297..5cb179a4a6 100644 --- a/components/vfs/vfs_uart.c +++ b/components/vfs/vfs_uart.c @@ -463,7 +463,7 @@ static void uart_end_select() _lock_release(&s_one_select_lock); } -#ifdef CONFIG_SUPPORT_TERMIOS +#ifdef CONFIG_VFS_SUPPORT_TERMIOS static int uart_tcsetattr(int fd, int optional_actions, const struct termios *p) { if (fd < 0 || fd >= UART_NUM) { @@ -913,7 +913,7 @@ static int uart_tcflush(int fd, int select) return 0; } -#endif // CONFIG_SUPPORT_TERMIOS +#endif // CONFIG_VFS_SUPPORT_TERMIOS void esp_vfs_dev_uart_register() { @@ -929,12 +929,12 @@ void esp_vfs_dev_uart_register() .access = &uart_access, .start_select = &uart_start_select, .end_select = &uart_end_select, -#ifdef CONFIG_SUPPORT_TERMIOS +#ifdef CONFIG_VFS_SUPPORT_TERMIOS .tcsetattr = &uart_tcsetattr, .tcgetattr = &uart_tcgetattr, .tcdrain = &uart_tcdrain, .tcflush = &uart_tcflush, -#endif // CONFIG_SUPPORT_TERMIOS +#endif // CONFIG_VFS_SUPPORT_TERMIOS }; ESP_ERROR_CHECK(esp_vfs_register("/dev/uart", &vfs, NULL)); }