Commit Graph
13293 Commits
Author SHA1 Message Date
J. Nick Koston 9733c28c40 [core] Cache lwip_sock pointers to eliminate per-socket fd lookup in fast select hot path
In yield_with_select_(), the fast select path iterated all monitored
sockets and called esphome_lwip_socket_has_data(fd) for each one.
That C function called lwip_socket_dbg_get_socket(fd) — a cross-
compilation-unit call that can't be inlined because sockets[] is
static in lwip's sockets.c. The actual rcvevent check is ~4
instructions, but the lookup adds entry/retw window overhead on
Xtensa (~8-12 cycles per socket per loop iteration).

Now lwip_sock* pointers are cached at socket registration time and
stored directly in monitored_sockets_. The hot path iterates pointers
and reads rcvevent with no fd lookup. esphome_lwip_hook_socket() also
takes lwip_sock* directly, avoiding a redundant get_sock() call.

API split for fast select vs fallback select:
- register_socket(lwip_sock*) / unregister_socket(lwip_sock*)
- register_socket_fd(int fd) / unregister_socket_fd(int fd)

Chained on top of socket-devirtualize (#14398).
2026-03-01 13:38:25 -10:00
J. Nick Koston 5d9c3a0e71 Fix clang-tidy: use make_unique and fix include order
- Replace std::unique_ptr{new ...} with make_unique
- Fix include order to satisfy clang-format
2026-03-01 00:23:05 -10:00
J. Nick Koston 529c79a8a9 Add NOLINT for redundant socket_ready_fd forward declaration
clang-tidy flags the forward declaration in application.h as redundant
since socket.h (included earlier via esphome.h) already declares it.
The forward declaration is needed here for the friend declaration.
2026-02-28 23:30:35 -10:00
J. Nick Koston 8cedf8f882 Restore comments from original code to minimize diff 2026-02-28 23:03:53 -10:00
J. Nick Koston 164001b50c Revert unnecessary socket_ip_loop_monitored rename
Keep the original function name since all callers already use it for
listening sockets. Only the return type changes to ListenSocket.
2026-02-28 23:00:32 -10:00
J. Nick Koston 7e119b1cbd Fix clang-tidy naming violations in lwip_raw_tcp_impl
- Rename internal_write/internal_output to internal_write_/internal_output_
  (protected methods require trailing underscore)
- Fix getpeername/getsockname parameter name mismatch between .h and .cpp
2026-02-28 22:56:48 -10:00
J. Nick Koston 39bbdbbfce Revert unrelated IRAM_ATTR change that leaked in from stash 2026-02-28 22:47:32 -10:00
J. Nick KostonandJ. Nick Koston 7a2452b3a2 Move LWIP_LOG and inline methods from header to cpp
The CI lint rule disallows ESP_LOG* references in header files.
Move LWIP_LOG macro definition and all methods that use it
(destructors, init(), static callbacks) to the .cpp file.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-28 22:43:24 -10:00
J. Nick KostonandJ. Nick Koston 807e786fac [socket] Devirtualize socket abstraction layer
Replace the virtual Socket base class with compile-time type aliases.
Since only one socket implementation is active per build (selected via
#ifdef), virtual dispatch was unnecessary overhead.

Each implementation (BSDSocketImpl, LwIPSocketImpl, LWIPRawImpl) is now
a concrete class in its own header with no virtual methods. socket::Socket
and socket::ListenSocket are type aliases to the active implementation.

For LWIP_TCP (ESP8266/RP2040), the listen socket is a separate type
(LWIPRawListenImpl) sharing a non-virtual LWIPRawCommon base with the
connected socket type (LWIPRawImpl). On BSD/LWIP_SOCKETS, both aliases
resolve to the same type.

This eliminates all vtable overhead, virtual destructors, and indirect
call overhead across all platforms.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-28 22:39:25 -10:00
J. Nick Koston 19bbd39e33 [uart] Enable wake-on-RX by default on ESP32 (#14391) 2026-02-28 21:06:46 -06:00
J. Nick KostonandCopilot 3f97b3b706 [core] Extract set_status_flag_ helper to deduplicate status_set methods (#14384)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-28 14:27:06 -10:00
J. Nick Koston 82e620bcf5 [ld2450] Single-pass zone target counting (#14387) 2026-02-28 14:26:55 -10:00
J. Nick Koston 80e0761bf1 [ld2450] Use integer dedup for direction text sensor updates (#14386) 2026-02-28 14:26:31 -10:00
J. Nick Koston c0781d3680 [ld2450] Use atan2f for angle calculation (#14388) 2026-02-28 14:26:08 -10:00
J. Nick Koston b7cb65ec49 [ci] Fix TypeError in ci-custom.py when POST lint checks fail (#14378) 2026-02-28 14:23:20 -10:00
J. Nick Koston fdbfac15db [uart] Replace wake-on-RX task+queue with direct ISR callback (#14382) 2026-03-01 00:21:08 +00:00
J. Nick KostonandCopilot 28424d6acd [ld2410][ld2412] Fix signed char causing incorrect distance values (#14380)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-28 23:50:12 +00:00
J. Nick Koston b679b04d14 [core] Move CONF_STOP_BITS, CONF_DATA_BITS, CONF_PARITY to const.py (#14379) 2026-02-28 13:27:33 -10:00
Jonathan SwobodaandCopilot b7d651dd17 [core] Defer entity automation codegen to prevent sibling ID deadlocks (#14381)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 13:10:53 -10:00
J. Nick Koston 757e8d90e6 [core] Inline set_component_state_ and use it in Application (#14369) 2026-02-28 07:20:34 -10:00
J. Nick Koston 7d52a9587f [api] Outline keepalive ping logic from APIConnection::loop() (#14374) 2026-02-28 07:20:20 -10:00
J. Nick Koston 067d773aac [core] Make register_component protected, remove runtime checks (#14371) 2026-02-28 07:19:55 -10:00
Clyde Stubbs 089d1e55e7 [mipi_dsi] Fix Waveshare P4 7B board config (#14372) 2026-02-28 20:37:04 +11:00
Raymond Richmond 6c0998f220 [gt911] Support for interrupt signal via IO Expander (#14358) 2026-02-28 18:26:06 +11:00
J. Nick KostonandClaude Opus 4.6 49cc389bf0 [esp32] Wrap printf/vprintf/fprintf to eliminate _vfprintf_r (~11 KB flash) (#14362)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:28:05 -10:00
J. Nick Koston 8480e8df9f [uart] Revert UART0 default pin workarounds (fixed in ESP-IDF 5.5.2) (#14363) 2026-02-27 17:27:51 -10:00
J. Nick Koston e7d4f2608b [sen6x] Fix test sensor ID collisions with sen5x (#14367) 2026-02-27 16:01:17 -10:00
Ryan Wagoner d1b4813197 [web_server] Add climate preset, fan mode, and humidity support (#14061) 2026-02-27 14:20:13 -10:00
Jonathan SwobodaandCopilot 298ee7b92e [gps] Fix codegen deadlock when automations reference sibling sensors (#14365)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 19:08:42 -05:00
J. Nick Koston 5c56b99742 [ci] Fix C++ unit tests missing time component dependency (#14364) 2026-02-27 13:19:11 -10:00
b9d70dcda2 [sen6x] Add SEN6x sensor support (#12553)
Co-authored-by: Martin Ebner <martinebner@me.com>
Co-authored-by: Tobias Stanzel <tobi.stanzel@gmail.com>
Co-authored-by: Big Mike <mike@bigmike.land>
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-27 16:41:28 -05:00
dependabot[bot] 5e3857abf7 Bump click from 8.1.7 to 8.3.1 (#11955)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-27 16:25:36 -05:00
Laura WrattenandJonathan Swoboda bb567827a1 [sht3xd] Allow sensors that don't support serial number read (#14224)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-27 16:23:32 -05:00
J. Nick KostonandClaude Opus 4.6 280f874edc [rp2040] Use native time_us_64() for millis_64() (#14356)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:18:02 -10:00
Jonathan SwobodaandCopilot f6755aabae [ci] Add PR title format check (#14345)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 15:18:07 -05:00
J. Nick Koston 52af4bced0 [component] Devirtualize call_dump_config (#14355) 2026-02-27 10:01:23 -10:00
J. Nick KostonandClaude Opus 4.6 63e757807e [zephyr] Use native k_uptime_get() for millis_64() (#14350)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:01:09 -10:00
dependabot[bot] edd63e3d2d Bump actions/download-artifact from 7.0.0 to 8.0.0 (#14327)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-27 14:43:10 -05:00
dependabot[bot] 32133e2f46 Bump ruff from 0.15.3 to 0.15.4 (#14357)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-27 14:42:20 -05:00
Clyde Stubbs 2255c68377 [esp32] Enable execute_from_psram for P4 (#14329) 2026-02-28 06:40:55 +11:00
J. Nick Koston 9c1d1a0d9f [color] Use integer math in Color::gradient to reduce code size (#14354) 2026-02-27 19:25:13 +00:00
J. Nick KostonandClaude Opus 4.6 8698b01bc7 [host] Use native clock_gettime for millis_64() (#14340)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 18:54:13 +00:00
J. Nick KostonandCopilot 3411ce2150 [core] Fix Application asm label for Mach-O using __USER_LABEL_PREFIX__ (#14334)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-27 08:49:57 -10:00
J. Nick Koston 29e1e8bdfd [wifi] Add LibreTiny component test configs (#14351) 2026-02-27 18:45:20 +00:00
J. Nick Koston 317dd5b2da [ci] Skip memory impact target branch build when tests don't exist (#14316) 2026-02-27 08:42:08 -10:00
Michael CassanitiandJonathan Swoboda 4ae7633418 [safe_mode] Add feature to explicitly mark a boot as successful (#14306)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-27 13:23:02 -05:00
J. Nick Koston c3a0eeceec [wifi] Use direct SDK APIs for LibreTiny SSID retrieval (#14349) 2026-02-27 18:17:17 +00:00
J. Nick Koston 4fe173b644 [wifi] Remove stale TODO comment for ESP8266 callback deferral (#14347) 2026-02-27 17:56:57 +00:00
J. Nick Koston 1c7f769ec7 [core] Add millis_64() HAL function with native ESP32 implementation (#14339) 2026-02-27 07:48:21 -10:00
72ca514cc2 [esp32_hosted] Add configurable SDIO clock frequency (#14319)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Deirdre <obyrne@rk1.lan>
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-27 17:25:53 +00:00