diff --git a/components/newlib/platform_include/sys/termios.h b/components/newlib/platform_include/sys/termios.h index fd0eb5ca8..c27e107be 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 38b252391..a8e68e72b 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 bccd5bf83..cb0c94b9b 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 b34679b20..c18397bdc 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 1d8abd8b3..3e711f254 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 000000000..92fb091ff --- /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 d46c7cb75..5c3d3f1d6 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 19f081c5a..ecbaf6acf 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 2bb865b29..5cb179a4a 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)); }