From 48a92430db0373c51a3b9e12838833051277996c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 10 Sep 2026 20:10:23 -0500 Subject: [PATCH] [remote_base] Keep the rc_switch protocol table in flash on ESP8266 --- esphome/components/remote_base/rc_switch_protocol.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/remote_base/rc_switch_protocol.h b/esphome/components/remote_base/rc_switch_protocol.h index 46d624f4ba..cf39f0eae7 100644 --- a/esphome/components/remote_base/rc_switch_protocol.h +++ b/esphome/components/remote_base/rc_switch_protocol.h @@ -65,11 +65,11 @@ class RCSwitchBase { uint32_t zero_low_{}; uint32_t one_high_{}; uint32_t one_low_{}; - bool inverted_{}; + uint32_t inverted_{}; // bool widened so every field is a word: the table is read from flash }; -// Constant-initialized: no global constructor, and in flash on platforms that map .rodata there -inline constexpr RCSwitchBase RC_SWITCH_PROTOCOLS[] = { +// Constant-initialized and kept in flash on every platform; all fields are 32-bit so ESP8266 can read it in place +inline constexpr RCSwitchBase RC_SWITCH_PROTOCOLS[] PROGMEM = { {0, 0, 0, 0, 0, 0, false}, {350, 10850, 350, 1050, 1050, 350, false}, {650, 6500, 650, 1300, 1300, 650, false},