Compare commits

...
+5
View File
@@ -46,6 +46,8 @@ class LightTargetStateReachedListener {
};
struct LightStateRTCState {
// User-provided so GCC stores the defaults instead of copying a constant, which is RAM on ESP8266
LightStateRTCState() {} // NOLINT(modernize-use-equals-default)
// Group 4-byte aligned members first
float brightness{1.0f};
float color_brightness{1.0f};
@@ -60,7 +62,10 @@ struct LightStateRTCState {
// Group smaller members at the end
ColorMode color_mode{ColorMode::UNKNOWN};
bool state{false};
// Zeroed so a saved copy has no unset padding bytes
uint8_t reserved_[2]{};
};
static_assert(sizeof(LightStateRTCState) == 44, "the saved layout must not change");
/** This class represents the communication layer between the front-end MQTT layer and the
* hardware output layer.