Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2026-03-18 09:51:59 -10:00
committed by GitHub
co-authored by Copilot Autofix powered by AI
parent 9498c554bf
commit 273419a237
+1 -1
View File
@@ -75,7 +75,7 @@ class OTAComponent : public Component {
*/
void notify_state_deferred_(OTAState state, float progress, uint8_t error) {
// Pack state, error, and progress into a single uint32_t so the lambda
// captures only [this, packed] (8 bytes) — fits in std::function SBO.
// captures only [this, packed] (8 bytes) — intended to fit in std::function SBO on supported toolchains.
// Layout: [state:8][error:8][progress_fixed:16] where progress is 010000 (0.01% resolution)
uint32_t packed = (static_cast<uint32_t>(state) << 24) | (static_cast<uint32_t>(error) << 16) |
static_cast<uint16_t>(progress * 100.0f);