Commit Graph

22794 Commits

Author SHA1 Message Date
J. Nick Koston
57727cba8e Merge remote-tracking branch 'upstream/fix-uart0-pin-setup' into integration 2026-02-19 17:22:18 -06:00
J. Nick Koston
dcff159a33 [uart] Make is_default_uart0_pin constexpr
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:20:54 -06:00
J. Nick Koston
d7f8ddb15f [uart] Always call pin setup for UART0 default pins on ESP-IDF
Fix UART0 communication failure on ESP-IDF 5.4.2+ that affected LD2410
and other UART sensors on default UART0 pins across all ESP32 variants.

The gpio_reset_pin() workaround from PR #12519 sets GPIO_MODE_DISABLE
which disables the input buffer. Without a subsequent pin->setup() call,
uart_set_pin() on IOMUX-connected UART0 default pins does not re-enable
the input buffer, so the RX pin cannot receive data.

PR #11914 made pin->setup() conditional on pull/open-drain flags, which
meant most users' UART0 RX pins never got their input buffer re-enabled.

The fix: always call pin->setup() for pins matching U0TXD_GPIO_NUM or
U0RXD_GPIO_NUM to restore proper GPIO direction after gpio_reset_pin().
For non-UART0 pins, the conditional behavior is preserved to avoid
breaking external components (issue #11823).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:19:47 -06:00
J. Nick Koston
3def55754c Merge branch 'fix-uart0-pin-setup' into integration 2026-02-19 17:16:36 -06:00
J. Nick Koston
e81eff22c3 [uart] Always call pin setup for UART0 default pins on ESP-IDF
Fix UART0 communication failure on ESP-IDF 5.4.2+ that affected LD2410
and other UART sensors on default UART0 pins across all ESP32 variants.

The gpio_reset_pin() workaround from PR #12519 sets GPIO_MODE_DISABLE
which disables the input buffer. Without a subsequent pin->setup() call,
uart_set_pin() on IOMUX-connected UART0 default pins does not re-enable
the input buffer, so the RX pin cannot receive data.

PR #11914 made pin->setup() conditional on pull/open-drain flags, which
meant most users' UART0 RX pins never got their input buffer re-enabled.

The fix: always call pin->setup() for pins matching U0TXD_GPIO_NUM or
U0RXD_GPIO_NUM to restore proper GPIO direction after gpio_reset_pin().
For non-UART0 pins, the conditional behavior is preserved to avoid
breaking external components (issue #11823).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:13:32 -06:00
J. Nick Koston
57e20e4192 Merge remote-tracking branch 'upstream/constexpr-progmem-codegen' into integration 2026-02-19 17:04:13 -06:00
J. Nick Koston
051cba20a3 Also use constexpr for size variables
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:02:48 -06:00
J. Nick Koston
9523670546 Merge branch 'remove-powf-normalize-accuracy' into integration 2026-02-19 16:50:04 -06:00
J. Nick Koston
9ce63603a6 Fix pow10_int comment accuracy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:48:55 -06:00
J. Nick Koston
5a8fa6a9cd Merge remote-tracking branch 'origin/integration' into integration 2026-02-19 16:40:45 -06:00
J. Nick Koston
0e6d0a0918 Merge branch 'constexpr-progmem' into integration 2026-02-19 16:40:31 -06:00
J. Nick Koston
c92ff7db81 Merge branch 'constexpr-progmem-codegen' into integration 2026-02-19 16:40:26 -06:00
J. Nick Koston
2866be72d9 Merge branch 'constexpr-progmem-cpp' into integration 2026-02-19 16:40:20 -06:00
J. Nick Koston
9e0237d68f [core] Use constexpr for hand-written PROGMEM arrays in C++
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:38:46 -06:00
J. Nick Koston
ad3b3387df [esp8266][web_server] Use constexpr for hand-written PROGMEM arrays in codegen
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:35:48 -06:00
J. Nick Koston
41346716cc [core] Use constexpr for PROGMEM arrays
Change progmem_array codegen from `static const` to `static constexpr`.
This ensures the compiler evaluates the array at compile time with no
runtime initialization, and is the correct qualifier for constant data
known at compile time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:33:38 -06:00
J. Nick Koston
bc72ad0035 Merge remote-tracking branch 'origin/constexpr-progmem' into integration 2026-02-19 16:31:21 -06:00
J. Nick Koston
6608b3493c [core] Use constexpr for PROGMEM arrays
Change progmem_array codegen from `static const` to `static constexpr`.
This ensures the compiler evaluates the array at compile time with no
runtime initialization, and is the correct qualifier for constant data
known at compile time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:30:16 -06:00
J. Nick Koston
ce6f7e3523 Merge remote-tracking branch 'origin/light-gamma-lut' into integration 2026-02-19 16:20:58 -06:00
J. Nick Koston
0af520f716 [light] Guard gamma LUT behind USE_LIGHT_GAMMA_LUT define
Only set when at least one light has gamma_correct configured.
On-off lights with no gamma get inline passthrough that the
compiler eliminates entirely — zero gamma code in the binary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:16:39 -06:00
J. Nick Koston
e520c7e982 Merge remote-tracking branch 'origin/remove-powf-dlms-kamstrup' into integration 2026-02-19 16:03:15 -06:00
J. Nick Koston
d2b0dd106a Merge remote-tracking branch 'origin/light-gamma-lut' into integration 2026-02-19 16:03:04 -06:00
J. Nick Koston
9b4dc0e40e [dlms_meter/kamstrup_kmp] Replace powf with pow10_int
Use the pow10_int() helper to replace the remaining powf(10, exp)
calls in dlms_meter and kamstrup_kmp components.

Also removes the now-unused <cmath> include from dlms_meter.

On builds where these are the only remaining powf call sites,
this eliminates powf/__ieee754_powf from the binary entirely.
2026-02-19 15:44:05 -06:00
J. Nick Koston
a7ffd9f674 [zephyr] Add missing progmem_read_uint16 implementation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:40:45 -06:00
J. Nick Koston
e95879ba6f Merge remote-tracking branch 'origin/remove-powf-normalize-accuracy' into integration 2026-02-19 15:32:33 -06:00
J. Nick Koston
6a8844e2fc [sensor] Replace powf with pow10_int in sensor filters
Add shared pow10_int() helper to helpers.h that computes 10^exp
using iterative multiplication/division instead of powf.

Replace powf(10, exp) calls in:
- sensor/filter.cpp: ValueListFilter and RoundFilter
- helpers.cpp: normalize_accuracy_decimals (refactored to use
  pow10_int for the general case, keeping -1/-2 fast paths)

Eliminates powf/__ieee754_powf from builds where sensor filters
are the only remaining powf call site.
2026-02-19 15:28:12 -06:00
J. Nick Koston
a81e422d33 Merge branch 'dev' into light-gamma-lut 2026-02-19 15:21:41 -06:00
J. Nick Koston
3730fff25d [light] Avoid unnecessary PROGMEM read in gamma_uncorrect_lut
Move the lo >= 255 early return before the first table read so
we don't waste a PROGMEM read that gets immediately discarded.
2026-02-19 15:17:25 -06:00
J. Nick Koston
c47e779cbc [light] Avoid unnecessary PROGMEM read in gamma_uncorrect_lut
Move the lo >= 255 early return before the first table read so
we don't waste a PROGMEM read that gets immediately discarded.
2026-02-19 15:17:14 -06:00
J. Nick Koston
4e09370252 Merge remote-tracking branch 'origin/light-gamma-lut' into integration 2026-02-19 15:09:06 -06:00
J. Nick Koston
ffb75eed3d Merge branch 'remove-powf-normalize-accuracy' into integration 2026-02-19 15:09:02 -06:00
J. Nick Koston
71c6a54990 [core] Fix deprecation dates for gamma_correct/gamma_uncorrect
Ships in 2026.3.0, so deprecation starts at 2026.3.0 with
6-month removal window at 2026.9.0.
2026-02-19 15:05:06 -06:00
J. Nick Koston
96f52da647 [light] Fix outdated comment on gamma_tables dict
Only the forward table is stored now; reverse gamma is computed
via binary search on the forward table.
2026-02-19 15:04:41 -06:00
J. Nick Koston
08c193d1d8 [light] Fix clang-format in gamma_table_reverse_search
Add braces to if/else in inline binary search function to
satisfy clang-format requirements.
2026-02-19 15:02:36 -06:00
J. Nick Koston
a71d1c8867 [light] Replace powf gamma correction with Python-generated PROGMEM LUTs
Replace runtime powf() calls in light gamma correction with
pre-computed uint16[256] PROGMEM lookup tables generated at
Python codegen time. The gamma value is a compile-time constant,
so the tables can be computed once and shared across all lights
with the same gamma value.

This eliminates powf/ieee754_powf (~2.3KB) from the binary.
Two 512-byte PROGMEM tables (forward + reverse) are shared per
unique gamma value, for a net savings of ~1.3KB flash and zero
RAM impact.

The LUT uses linear interpolation between table entries,
achieving zero PWM errors at both 8-bit and 16-bit resolution
compared to the old powf-based approach.

Breaking change: gamma parameter removed from
LightColorValues::as_*() methods since gamma correction is now
applied externally via LightState::gamma_correct_lut().
gamma_correct() and gamma_uncorrect() in helpers.h are
deprecated (removal in 2026.12.0).
2026-02-19 14:56:10 -06:00
Jonathan Swoboda
17a810b939 [wifi] Sync output_power with PHY max TX power to prevent brownout (#14118)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:14:48 -05:00
J. Nick Koston
4aa8f57d36 [json] Add SerializationBuffer for stack-first JSON serialization (#13625) 2026-02-19 14:08:44 -06:00
J. Nick Koston
d2b7d40716 Clamp accuracy_decimals to -9 to prevent uint32_t overflow 2026-02-19 12:17:19 -06:00
J. Nick Koston
77ef231a3a Merge branch 'remove-powf-normalize-accuracy' into integration 2026-02-19 12:11:28 -06:00
J. Nick Koston
2bb077cb1f [core] Replace powf with integer math in normalize_accuracy_decimals
Replace powf(10.0f, accuracy_decimals) with integer divisor computation
to avoid pulling in __ieee754_powf (~2.2KB) on builds where this is
the only powf call site.

Tested on ESP8266 with web_server: -3.1KB flash, -16 bytes RAM.
2026-02-19 12:10:51 -06:00
J. Nick Koston
7ff3ac59cb Merge remote-tracking branch 'origin/dev' into integration 2026-02-19 11:48:30 -06:00
Jonathan Swoboda
f2c98d6126 [safe_mode] Log brownout as reset reason on OTA rollback (#14113)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:45:04 +00:00
J. Nick Koston
7a5c3cee0d [esp32_ble] Enable CONFIG_BT_RELEASE_IRAM on ESP32-C2 (#14109)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:41:00 +00:00
Jonathan Swoboda
9aa17984df [pulse_counter] Fix build failure when use_pcnt is false (#14111)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:25:26 +00:00
Jonathan Swoboda
da616e0557 [ethernet] Improve clk_mode deprecation warning with actionable YAML (#14104)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:00:05 +00:00
Kevin Ahrendt
d2026b4cd7 [audio] Disable FLAC CRC validation to improve decoding efficiency (#14108) 2026-02-19 11:56:34 -05:00
Jonathan Swoboda
ed74790eed [i2c] Remove deprecated stop parameter overloads and readv/writev methods (#14106)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:56:06 +00:00
Jonathan Swoboda
bf2e22da4f [esp32] Remove deprecated add_idf_component() parameters and IDF component refresh option (#14105)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:55:03 +00:00
J. Nick Koston
04268ebe1d Merge remote-tracking branch 'swoboda1337/remove-ethernet-clk-mode-deprecated' into integration 2026-02-19 10:35:53 -06:00
J. Nick Koston
fb27b8729e Merge remote-tracking branch 'origin/scheduler-reduce-defer-locks' into integration 2026-02-19 10:35:34 -06:00