From 2ad3067abdcdb511eff96123af4aed9ee3391dee Mon Sep 17 00:00:00 2001 From: dongheng Date: Wed, 17 Apr 2019 19:48:07 +0800 Subject: [PATCH] feat(vfs): Disable VFS used by default Console component must use VFS. --- components/lwip/port/esp8266/include/lwipopts.h | 4 ++++ components/newlib/newlib/port/select.c | 3 ++- components/vfs/Kconfig | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/lwip/port/esp8266/include/lwipopts.h b/components/lwip/port/esp8266/include/lwipopts.h index 1dd95526..00c9fdd6 100644 --- a/components/lwip/port/esp8266/include/lwipopts.h +++ b/components/lwip/port/esp8266/include/lwipopts.h @@ -1425,7 +1425,11 @@ size_t memp_malloc_get_size(size_t type); * re implement read/write/close/ioctl/fnctl to send the requested action to the right * library (sharing select will need more work though). */ +#ifdef CONFIG_USING_ESP_VFS #define LWIP_SOCKET_OFFSET (FD_SETSIZE - CONFIG_LWIP_MAX_SOCKETS) +#else +#define LWIP_SOCKET_OFFSET 0 +#endif /** * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT diff --git a/components/newlib/newlib/port/select.c b/components/newlib/newlib/port/select.c index 0a9630f3..1f641e2a 100644 --- a/components/newlib/newlib/port/select.c +++ b/components/newlib/newlib/port/select.c @@ -13,10 +13,11 @@ // limitations under the License. #include -#include "esp_vfs.h" #include "sdkconfig.h" #ifdef CONFIG_USING_ESP_VFS +#include "esp_vfs.h" + #ifdef CONFIG_USE_ONLY_LWIP_SELECT #include "lwip/sockets.h" diff --git a/components/vfs/Kconfig b/components/vfs/Kconfig index f1719a53..8894f7e1 100644 --- a/components/vfs/Kconfig +++ b/components/vfs/Kconfig @@ -2,7 +2,7 @@ menu "Virtual file system" config USING_ESP_VFS bool "Using espressif VFS" - default y + default n help Enable this option, espressif VFS can be used. Users can use APIs like "open", "read", "write" and so on to operate I/O device which is registered.