[wifi] Avoid .rodata RAM cost for ManualIP on ESP8266

On ESP8266, .rodata is mapped to DRAM (RAM), not flash. When
StructInitializer is used with all compile-time constant fields,
the compiler places the entire struct as a const blob in .rodata,
silently consuming ~20 bytes of RAM.

Switch to field-by-field assignment on ESP8266 so the IP address
values are encoded as immediate operands in flash instructions
instead of a .rodata blob. Other platforms continue to use the
aggregate initializer since their .rodata is flash-mapped.
This commit is contained in:
J. Nick Koston
2026-02-23 16:06:28 -06:00
parent 4a52900352
commit abcd89cd1f
2 changed files with 23 additions and 5 deletions

View File

@@ -1,6 +1,12 @@
wifi:
min_auth_mode: WPA2
post_connect_roaming: true
manual_ip:
static_ip: 192.168.1.100
gateway: 192.168.1.1
subnet: 255.255.255.0
dns1: 1.1.1.1
dns2: 8.8.8.8
packages:
- !include common.yaml