Commit Graph
25507 Commits
Author SHA1 Message Date
J. Nick Koston 4a2ff62d68 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-22 12:58:13 -10:00
J. Nick Koston d0e705d948 [core] Inline Application::loop() to eliminate stack frame (#15041) 2026-03-22 12:46:28 -10:00
J. Nick Koston 2c06464f7b [packet_transport] Use FixedVector and parent pointer to enable inline Callback storage (#14946) 2026-03-22 12:41:54 -10:00
J. Nick Koston 84727b1f71 [esp32] Validate eFuse MAC reads and reject garbage MACs (#15049) 2026-03-22 12:41:01 -10:00
J. Nick Koston aef987dccf [core] Fix Callback::create memcpy from function reference (#14995) 2026-03-22 12:37:46 -10:00
J. Nick Koston b2b61bea6a [web_server_idf] Inline send() to reduce httpd task stack depth (#15045) 2026-03-22 12:33:06 -10:00
J. Nick Koston 30f66be1da [esp32] Mention ignore_pin_validation_error in flash pin error message (#14998) 2026-03-22 12:32:42 -10:00
J. Nick Koston 6caa9ee227 [logger] Move log level lookup tables to PROGMEM (#15003) 2026-03-22 12:32:08 -10:00
J. Nick Koston 9152f77cdd [core] Reduce automation call chain stack depth (#15042) 2026-03-22 12:31:48 -10:00
J. Nick Koston 4d09eb2cec [tests] Fix flaky ld24xx integration tests by disabling API batching (#15050) 2026-03-22 12:29:28 -10:00
J. Nick Koston 5cc4f6e85a [logger] Add task_log_buffer_zephyr.cpp to platform source filter (#15081) 2026-03-22 12:29:12 -10:00
J. Nick Koston 27f3a5f5f4 [sht4x] Add missing hal.h include for millis() on ESP-IDF (#15087) 2026-03-22 11:54:54 -10:00
J. Nick Koston 593dbc9e67 [logger] Fix unit test and benchmark Logger constructor calls (#15085) 2026-03-23 09:50:58 +13:00
J. Nick Koston daafa8faa3 [wifi] Inline trivial WiFiAP and WiFiComponent accessors (#15075) 2026-03-22 10:36:18 -10:00
Jason Kölker 2b6d63fd09 [pmsx003] Keep active-mode reads aligned (#14832) 2026-03-23 09:21:08 +13:00
c917b8ce06 [logger] Fix race condition in task log buffer initialization (#15071)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-23 09:20:28 +13:00
Jonathan Swoboda 12b10d8b89 [ultrasonic] Fix ISR edge detection with debounce and trigger filtering (#15014) 2026-03-22 16:19:46 -04:00
J. Nick Koston 6a77b8b1f4 [light] Fix gamma LUT quantizing small brightness to zero (#15060) 2026-03-23 09:19:28 +13:00
J. Nick Koston ba4be2a904 [uart] Fix RTL87xx compilation failure due to SUCCESS macro collision (#15054) 2026-03-23 09:17:59 +13:00
J. Nick Koston ca0523b86c [sht4x] Fix heater causing measurement jitter (#15030) 2026-03-23 09:16:46 +13:00
J. Nick KostonandCopilot 5e68282519 [light] Fix constant_brightness broken by gamma LUT refactor (#15048)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-23 09:14:52 +13:00
Clyde Stubbs a0d5525312 [lvgl] Meter fixes (#15073) 2026-03-22 19:01:49 +11:00
J. Nick Koston 5aff931c68 Merge remote-tracking branch 'upstream-ssh/devirtualize-decode' into integration 2026-03-21 20:52:39 -10:00
J. Nick Koston a5bd718fc9 [api] Make ProtoDecodableMessage::decode() non-virtual
decode() is never called polymorphically - all call sites in
read_message_() use concrete types. The only indirect call site was
decode_to_message(), which also always knows the concrete type.

Convert decode_to_message() to a template so the concrete type is
preserved, allowing decode() to be non-virtual. The two classes that
override decode() (ExecuteServiceArgument, ExecuteServiceRequest) now
hide the base method, which works since all calls use concrete types.

This removes one vtable slot (4 bytes) from each decodable message
class vtable, saving ~148 bytes of flash.
2026-03-21 20:51:28 -10:00
J. Nick Koston 0434bf40ba Merge remote-tracking branch 'upstream/inline-wifi-ap-channel-accessors' into integration 2026-03-21 20:32:12 -10:00
J. Nick Koston c194d134fd [wifi] Inline WiFiComponent::has_sta(), has_ap(), is_ap_active()
Trivial boolean accessors that benefit from inlining.
2026-03-21 20:31:50 -10:00
J. Nick Koston 0c81963eb9 Merge remote-tracking branch 'upstream/inline-wifi-ap-channel-accessors' into integration 2026-03-21 20:24:54 -10:00
J. Nick Koston 1db789313b [wifi] Inline WiFiAP::get_channel() and has_channel() in header
These trivial accessors (12 bytes each) benefit from inlining,
matching the style of the adjacent get_priority() accessor.
2026-03-21 20:21:20 -10:00
J. Nick Koston a87b5ed534 Merge remote-tracking branch 'upstream/fix-logger-task-log-buffer-race' into integration 2026-03-21 17:04:32 -10:00
J. Nick Koston e32565b36a Inline init_log_buffer_ into constructor 2026-03-21 17:00:26 -10:00
J. Nick Koston b0e6f57bc2 Remove disable_loop from init_log_buffer_ to avoid ESP_LOGVV before global_logger is set
Since init_log_buffer_ is now called from the constructor (before
pre_setup sets global_logger), calling disable_loop() would trigger
ESP_LOGVV which dereferences the null global_logger pointer.

The loop self-disables on its first iteration when no messages are
found, so the explicit disable in init_log_buffer_ was unnecessary.
2026-03-21 16:58:55 -10:00
pre-commit-ci-lite[bot] cbea4e0ccf [pre-commit.ci lite] apply automatic fixes 2026-03-22 02:56:50 +00:00
J. Nick KostonandCopilot 44ea4a2235 Update esphome/components/logger/logger.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-21 16:55:15 -10:00
J. Nick Koston 6576e88df0 Rename init_log_buffer to init_log_buffer_ for clang-tidy naming 2026-03-21 16:53:25 -10:00
J. Nick Koston 1ccfd0b3cd [logger] Fix race condition in task log buffer initialization
Move TaskLogBuffer allocation from init_log_buffer() (called at
DIAGNOSTICS priority) into the Logger constructor (called at
EARLY_INIT priority). This ensures the buffer exists before
global_logger is set, eliminating a window where another FreeRTOS
task could dereference a null log_buffer_ pointer.

Fixes crash: Guru Meditation Error: Core 0 panic'ed (Load access fault)
in TaskLogBuffer::send_message_thread_safe when a task logs before
init_log_buffer() is called.
2026-03-21 16:48:50 -10:00
J. Nick Koston c48fd0738b [mqtt] Rate-limit component resends to prevent task WDT on reconnect (#15061) 2026-03-21 15:33:42 -10:00
J. Nick Koston 8224da3460 [core] Inline Component::get_component_log_str() (#15068) 2026-03-21 15:32:24 -10:00
Clyde Stubbs dd82a91d8f [lvgl] Don't animate page change when not requested (#15069) 2026-03-22 11:13:17 +11:00
J. Nick Koston 86ec218f75 [benchmark] Add plaintext API frame write benchmarks (#15036) 2026-03-21 13:15:35 -10:00
J. Nick Koston f6c0e28db8 Merge remote-tracking branch 'upstream/inline-get-component-log-str' into integration 2026-03-21 12:12:21 -10:00
J. Nick Koston 30b4508320 [core] Inline Component::get_component_log_str()
Move trivial null-check getter from component.cpp to component.h
so the compiler can inline it at call sites, eliminating function
call overhead in hot logging paths.
2026-03-21 12:04:46 -10:00
J. Nick Koston 8978ea7479 Merge remote-tracking branch 'upstream/precompute-tag-forced-varint-fields' into integration 2026-03-21 11:49:43 -10:00
J. Nick Koston da926d904e [api] Precompute tag bytes for forced varint and length-delimited fields
Extend the precomputed-tag approach from fixed32 key fields to all forced
fields with single-byte tags (field IDs 1-15). The code generator now
emits write_raw_byte(tag) followed by the raw encode primitive instead
of calling the full encode_* method.

For varint types (uint32, uint64, sint32, sint64, int64, bool, enum),
this eliminates the zero-check branch and encode_field_raw indirection.
For length-delimited types (bytes, string), it additionally skips the
encode_string wrapper.

Benchmarked on real hardware with BluetoothLERawAdvertisementsResponse
(12 advertisements per message, 10000 iterations):

ESP32 (Xtensa dual-core 240MHz):
  encode: 38498 -> 30460 ns/op (-20.9%)
  calc+encode: 48479 -> 40458 ns/op (-16.6%)

ESP32-C3 (RISC-V single-core 160MHz):
  encode: 54199 -> 40342 ns/op (-25.6%)
  calc+encode: 57800 -> 51365 ns/op (-11.1%)
2026-03-21 11:48:28 -10:00
J. Nick Koston cb1eb0555d Merge remote-tracking branch 'upstream/mqtt-reconnect-wdt-fix' into integration 2026-03-21 10:32:35 -10:00
J. Nick Koston a3f64b6583 Merge remote-tracking branch 'upstream/fix-uart-rtl87xx-success-macro' into integration 2026-03-21 10:32:31 -10:00
J. Nick Koston 3f1bf4cd69 Merge remote-tracking branch 'upstream/fix-gamma-lut-zero-quantization' into integration 2026-03-21 10:32:28 -10:00
J. Nick Koston 6db577f1f2 Merge remote-tracking branch 'upstream/api/peel-first-write-iteration' into integration 2026-03-21 10:32:18 -10:00
J. Nick Koston 21ca02dd3d [api] Peel first iteration of write_protobuf_messages for single-message fast path
The single-message case (via write_protobuf_packet) is the most common
path. Peeling the first loop iteration and outlining the multi-message
batch path avoids the ~300-byte StaticVector<iovec> stack allocation
on the hot path.

Plaintext write_protobuf_messages:
- Stack frame: 352 → 64 bytes
- Code size: 246 → 127 bytes

Noise write_protobuf_messages:
- Extracted encrypt_noise_message_ helper for reuse
- Same peeling pattern with outlined batch path
2026-03-21 09:38:35 -10:00
J. Nick Koston 44e1a86819 [benchmark] Use TCP loopback sockets and correct message type
Use real TCP sockets instead of AF_UNIX socketpair so TCP_NODELAY
succeeds during init() and the benchmark exercises the full write
path. Replace hardcoded message type 38 with SensorStateResponse::MESSAGE_TYPE.
2026-03-21 09:02:17 -10:00
J. Nick Koston 135c599561 [benchmark] Pre-init APIBuffer to 1460 bytes in plaintext frame benchmarks
Avoid benchmarking heap allocation by pre-reserving the buffer
to typical TCP MSS size and reusing it across iterations, matching
real-world usage where the buffer persists across writes.
2026-03-21 08:48:15 -10:00