Commit Graph
25413 Commits
Author SHA1 Message Date
J. Nick Koston ed77c547cc Merge remote-tracking branch 'origin/reduce-automation-call-stack' into integration 2026-03-20 19:20:24 -10:00
J. Nick Koston fcaaa46bd9 [core] Use ESPHOME_ALWAYS_INLINE macro for consistency 2026-03-20 19:20:02 -10:00
J. Nick Koston 846b7f6a1f Merge remote-tracking branch 'origin/inline-application-loop' into integration 2026-03-20 19:14:29 -10:00
J. Nick Koston 41a2531d45 Merge remote-tracking branch 'origin/reduce-automation-call-stack' into integration 2026-03-20 19:14:01 -10:00
J. Nick Koston 60df1b436e [socket] Add NOLINT for socket_delay forward declaration
Suppress readability-redundant-declaration warning triggered by the
forward declaration added in application.h for inline yield_with_select_.
2026-03-20 19:14:00 -10:00
J. Nick Koston 3be2b57c15 Merge remote-tracking branch 'upstream/inline-application-loop' into integration 2026-03-20 19:05:34 -10:00
J. Nick Koston 1918e17c21 [core] Inline yield_with_select_ on all embedded platforms
Inline yield_with_select_ for ESP8266/RP2040 (socket_delay) and
no-socket (delay) paths in addition to the LWIP_FAST_SELECT path.
Only the select() fallback (host platform) remains in the .cpp.

This ensures yield_with_select_ is inlined into the loop on all
embedded platforms, not just ESP32/LibreTiny.
2026-03-20 19:05:01 -10:00
J. Nick Koston bfa446a28e [core] Switch to always_inline only, drop play_complex overrides
The play_complex overrides cost flash per template instantiation
across every automation. The always_inline on the forwarding chain
(Trigger::trigger, Automation::trigger, ActionList::play) is a
fixed cost that collapses 3 frames into 1.
2026-03-20 18:59:45 -10:00
J. Nick Koston 9227d8f2dd [core] Restore play_complex overrides for LambdaAction and ContinuationAction
The +384 flash was from the always_inline attributes (already removed),
not from the play_complex overrides.
2026-03-20 18:52:48 -10:00
J. Nick Koston aacc7e54d2 [core] Limit play_complex override to StatelessLambdaAction only
LambdaAction and ContinuationAction overrides caused flash bloat
by replacing shared base class play_complex instantiations with
per-class copies. StatelessLambdaAction is the most common
automation action and its no-args variant is only 24 bytes.
2026-03-20 18:52:12 -10:00
J. Nick Koston 884db8060a [core] Use qualified calls and add comments explaining overrides 2026-03-20 18:48:51 -10:00
J. Nick Koston 536093acfa [core] Drop always_inline attributes to avoid flash bloat
The always_inline on Trigger::trigger(), ActionList::play(), and
Automation::trigger() duplicates code at every trigger call site,
adding ~384 bytes of flash. Revert to compiler-managed inlining
and keep only the play_complex overrides (phase 2).
2026-03-20 18:46:46 -10:00
J. Nick Koston 998d61f434 [core] Inline yield_with_select_ fast path for LWIP_FAST_SELECT
When USE_LWIP_FAST_SELECT is defined (ESP32/LibreTiny), move the
yield_with_select_ implementation to application.h as always_inline.
This eliminates another stack frame from the hot loop path on these
platforms. The fallback select()/delay() paths for other platforms
remain in application.cpp.
2026-03-20 18:42:55 -10:00
J. Nick Koston 34345b86fa [core] Reduce automation call chain stack depth
Force-inline the Trigger→Automation→ActionList forwarding chain
and override play_complex() in leaf action classes to skip the
virtual play() dispatch, reducing the button→lambda call stack
from 8 frames to ~4.
2026-03-20 18:36:07 -10:00
J. Nick Koston e15782844e [core] Inline after_loop_tasks_() into header
Trivial one-liner (single assignment) called from the inlined loop()
and setup(). Eliminates another unnecessary function call.
2026-03-20 18:34:55 -10:00
J. Nick Koston ae4e2aebb9 Merge remote-tracking branch 'origin/inline-application-loop' into integration 2026-03-20 18:29:57 -10:00
J. Nick Koston 9d2d4f2243 [core] Inline Application::loop() to eliminate stack frame
Move Application::loop() from application.cpp to application.h as
inline ESPHOME_ALWAYS_INLINE so the compiler can inline it at all
call sites. On ESP32, loop_task() now calls App.loop() directly
instead of going through the generated loop() wrapper.

This eliminates one stack frame from the main loop call chain on
all platforms, producing cleaner crash backtraces and reducing
function call overhead on every loop iteration.
2026-03-20 18:27:24 -10:00
J. Nick Koston d203a46ef8 [api] Enable HAVE_WEAK_SYMBOLS and HAVE_INLINE_ASM for libsodium (#15038) 2026-03-21 04:17:37 +00:00
J. Nick Koston 7b6312a819 Merge remote-tracking branch 'upstream/libsodium-enable-weak-symbols' into integration 2026-03-20 18:02:29 -10:00
J. Nick Koston 98d3520e2d Merge branch 'dev' into libsodium-enable-weak-symbols 2026-03-20 17:46:22 -10:00
J. Nick Koston 1920d8a887 [benchmark] Add noise encryption benchmarks (#15037) 2026-03-20 17:35:17 -10:00
J. Nick Koston cc58cffb7b [api] Enable HAVE_WEAK_SYMBOLS and HAVE_INLINE_ASM for libsodium
Without these flags, libsodium's sodium_memzero() falls through to the
slowest fallback: a volatile byte-by-byte zeroing loop. With them, it
uses memset() guarded by a weak-symbol call and inline asm memory
clobber, which is significantly faster.

This also improves sodium_memcmp() and sodium_compare() codegen by
allowing non-volatile pointer access with weak barriers, and enables
a timing-safe comparison optimization in crypto_verify.

Both flags are safe for all ESPHome targets: __attribute__((weak)) and
__asm__ are core GCC features supported by all toolchains (Xtensa,
RISC-V, ARM, x86_64).
2026-03-20 16:58:34 -10:00
J. Nick Koston 95dea59382 [core] Use SplitMix32 PRNG for random_uint32() (#14984) 2026-03-20 15:25:54 -10:00
J. Nick Koston f3cddcee21 [core] Store parent pointers as members to enable inline Callback storage (#14923) 2026-03-20 15:25:40 -10:00
J. Nick Koston 0e9936f9fa Merge remote-tracking branch 'upstream/dev' into integration 2026-03-20 15:14:58 -10:00
J. Nick KostonandCopilot 21e384cafd [esp32] Disable PicolibC Newlib compatibility shim on IDF 6.0+ (#15008)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-20 15:10:18 -10:00
J. Nick Koston 32db055b98 [number] Clean up NumberCall::perform() increment/decrement logic (#15000) 2026-03-20 15:09:28 -10:00
J. Nick Koston 2c87260046 [core] Optimize Component::is_ready() with bitmask check (#15005) 2026-03-20 15:09:13 -10:00
J. Nick Koston 51ccad8461 [preferences] Shorten TAG strings across all platforms (#15004) 2026-03-20 15:09:01 -10:00
J. Nick Koston 7f500c4b6e [modbus] Fix size_t format warning in clear_rx_buffer_ (#15002) 2026-03-20 15:08:46 -10:00
J. Nick Koston 564d155cb6 [wifi] Use LOG_STR_LITERAL for scan complete log on ESP8266 (#15001) 2026-03-20 15:08:33 -10:00
J. Nick Koston edf5542559 [analyze-memory] Attribute extern C symbols to components via source file mapping (#15006) 2026-03-20 15:05:17 -10:00
J. Nick Koston 51335e8830 [ledc] Fix deprecated intr_type warning on ESP-IDF 6.0+ (#15009) 2026-03-20 15:01:30 -10:00
J. Nick Koston 391ffe34f8 [rp2040] Fix get_mac_address_raw to use ethernet MAC when WiFi unavailable (#15033) 2026-03-20 15:01:11 -10:00
J. Nick Koston 12ead0408a [gpio] Use constexpr uint32_t timer ID for interlock timeout (#15010) 2026-03-20 15:00:56 -10:00
Daniel KentandJonathan Swoboda 2d39cc2540 [spa06_i2c] Add SPA06-003 Temperature and Pressure Sensor - I2C support (Part 2 of 3) (#14522)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-21 00:38:04 +00:00
J. Nick Koston 8662910be0 Merge remote-tracking branch 'origin/rp2040-ethernet-mac' into integration 2026-03-20 14:22:56 -10:00
J. Nick Koston 830f766f0c Merge remote-tracking branch 'upstream/fix-sht4x-heater-jitter' into integration 2026-03-20 14:22:50 -10:00
J. Nick Koston f8af7354b1 [rp2040] Fix get_mac_address_raw to use ethernet MAC when WiFi unavailable
On RP2040, get_mac_address_raw() only queried WiFi.macAddress(). When
ethernet is configured without WiFi, the MAC address was left
uninitialized, causing get_mac_address() and get_mac_address_pretty()
to return all zeros. This affects device identification (API, mDNS,
unique ID).

Unlike ESP32 which reads from eFuse (always available regardless of
network interface), RP2040 must query the actual network driver.

Fall back to ethernet::global_eth_component->get_eth_mac_address_raw()
when USE_ETHERNET is defined and USE_WIFI is not.
2026-03-20 14:17:49 -10:00
J. Nick Koston 0302a14fa2 [sht4x] Restore original comments removed in refactor 2026-03-20 14:10:40 -10:00
J. Nick Koston 464d333142 [sht4x] Fire heater after measurement instead of skipping cycles
Per swoboda1337's suggestion, run the heater after the measurement
read instead of before. This maximizes cooldown time before the
next reading and avoids skipping any measurement cycles.
2026-03-20 14:08:36 -10:00
J. Nick Koston a9a8f4cb3b [time] Fix timezone_offset() and recalc_timestamp_local() always returning UTC (#14996) 2026-03-20 13:58:14 -10:00
J. Nick Koston 8fa2e75afa [core] Add copy() method to StringRef for std::string compatibility (#15028) 2026-03-20 13:58:02 -10:00
J. Nick KostonandCopilot 0b01f9fc42 [web_server] Increase httpd task stack size to prevent stack overflow (#14997)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-20 13:57:51 -10:00
Jonathan Swoboda ed8c062d9f [esp32_touch] Fix initial state never published when sensor untouched (#15032) 2026-03-20 19:53:02 -04:00
J. Nick Koston c2b2aaddd1 [sht4x] Move timestamp update after successful command, add heater test
Only advance last_heater_millis_ after the heater command succeeds
so a failed write retries on the next cycle instead of silently
skipping.

Add heater settings to the test YAML to ensure CI exercises the
heater code path.
2026-03-20 12:57:53 -10:00
J. Nick Koston a73b5cc94a [sht4x] Ensure normal measurement between heater cycles
When heater_interval < update_interval, the heater would fire on
nearly every update cycle, skipping almost all real measurements.
Push the next eligible heater time forward by at least one
update_interval to guarantee at least one ambient reading between
heater activations.
2026-03-20 12:55:01 -10:00
J. Nick Koston 43ff2157b9 [sht4x] Fix heater causing measurement jitter
Integrate heater activation into the measurement cycle instead of
running it on an independent timer. The separate heater interval
could overlap with measurement polling, causing readings to be
taken while the sensor was still hot.

Now the heater fires during update() when due, skipping that
measurement cycle. The next regular update() takes an ambient
reading after the sensor has cooled.

Also replace magic numbers with named constexpr constants for
the datasheet conversion formulas.

Closes https://github.com/esphome/esphome/issues/15011
2026-03-20 12:49:24 -10:00
J. Nick Koston 3541dced07 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-20 12:25:10 -10:00
J. Nick Koston 6a545efa62 Merge remote-tracking branch 'upstream/fix-httpd-stack-overflow' into integration 2026-03-20 12:25:07 -10:00