From cd2d3f061d78018b2b16b35adb137e1e9b47cff6 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 20 Oct 2025 19:58:24 -1000 Subject: [PATCH 1/2] [espnow] Fix compilation error with initializer_list after #11433 (#11436) --- esphome/components/espnow/automation.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/espnow/automation.h b/esphome/components/espnow/automation.h index 2416377859..5415b088fd 100644 --- a/esphome/components/espnow/automation.h +++ b/esphome/components/espnow/automation.h @@ -14,13 +14,13 @@ template class SendAction : public Action, public Parente TEMPLATABLE_VALUE(std::vector, data); public: - void add_on_sent(const std::vector *> &actions) { + void add_on_sent(const std::initializer_list *> &actions) { this->sent_.add_actions(actions); if (this->flags_.wait_for_sent) { this->sent_.add_action(new LambdaAction([this](Ts... x) { this->play_next_(x...); })); } } - void add_on_error(const std::vector *> &actions) { + void add_on_error(const std::initializer_list *> &actions) { this->error_.add_actions(actions); if (this->flags_.wait_for_sent) { this->error_.add_action(new LambdaAction([this](Ts... x) { From 572af76beee697ab2e807a467bc85779f510aa70 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 20 Oct 2025 20:49:12 -1000 Subject: [PATCH 2/2] [esp32] Add advanced options to disable unused VFS features (saves ~5 KB flash) --- esphome/components/esp32/__init__.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index 99a87e06f9..a30e4fd1b7 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -550,6 +550,8 @@ CONF_ENABLE_LWIP_BRIDGE_INTERFACE = "enable_lwip_bridge_interface" CONF_ENABLE_LWIP_TCPIP_CORE_LOCKING = "enable_lwip_tcpip_core_locking" CONF_ENABLE_LWIP_CHECK_THREAD_SAFETY = "enable_lwip_check_thread_safety" CONF_DISABLE_LIBC_LOCKS_IN_IRAM = "disable_libc_locks_in_iram" +CONF_DISABLE_VFS_SUPPORT_TERMIOS = "disable_vfs_support_termios" +CONF_DISABLE_VFS_SUPPORT_SELECT = "disable_vfs_support_select" def _validate_idf_component(config: ConfigType) -> ConfigType: @@ -615,6 +617,12 @@ FRAMEWORK_SCHEMA = cv.All( cv.Optional( CONF_DISABLE_LIBC_LOCKS_IN_IRAM, default=True ): cv.boolean, + cv.Optional( + CONF_DISABLE_VFS_SUPPORT_TERMIOS, default=True + ): cv.boolean, + cv.Optional( + CONF_DISABLE_VFS_SUPPORT_SELECT, default=True + ): cv.boolean, cv.Optional(CONF_EXECUTE_FROM_PSRAM): cv.boolean, } ), @@ -962,6 +970,23 @@ async def to_code(config): if advanced.get(CONF_DISABLE_LIBC_LOCKS_IN_IRAM, True): add_idf_sdkconfig_option("CONFIG_LIBC_LOCKS_PLACE_IN_IRAM", False) + # Disable VFS support for termios (terminal I/O functions) + # ESPHome doesn't use termios functions on ESP32 (only used in host UART driver). + # Saves approximately 1.8KB of flash when disabled (default). + add_idf_sdkconfig_option( + "CONFIG_VFS_SUPPORT_TERMIOS", + not advanced.get(CONF_DISABLE_VFS_SUPPORT_TERMIOS, True), + ) + + # Disable VFS support for select() with file descriptors + # ESPHome only uses select() with sockets via lwip_select(), which still works. + # VFS select is only needed for UART/eventfd file descriptors, which ESPHome doesn't use. + # Saves approximately 2.7KB of flash when disabled (default). + add_idf_sdkconfig_option( + "CONFIG_VFS_SUPPORT_SELECT", + not advanced.get(CONF_DISABLE_VFS_SUPPORT_SELECT, True), + ) + cg.add_platformio_option("board_build.partitions", "partitions.csv") if CONF_PARTITIONS in config: add_extra_build_file(