From 6c06a826e93beac8b7ccd9d5acd64e1265c2d7b5 Mon Sep 17 00:00:00 2001 From: NewoPL <27411874+NewoPL@users.noreply.github.com> Date: Sun, 3 Nov 2024 08:56:38 +0100 Subject: [PATCH] [kp18058]: missing iterator problem --- esphome/components/kp18058/kp18058.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/kp18058/kp18058.cpp b/esphome/components/kp18058/kp18058.cpp index b181f41c41..a75ff654d1 100644 --- a/esphome/components/kp18058/kp18058.cpp +++ b/esphome/components/kp18058/kp18058.cpp @@ -91,8 +91,8 @@ void KP18058::program_led_driver() { // Calculate parity bits for each byte uint8_t *settings_bytes = reinterpret_cast(&settings); - for (auto &byte : settings_bytes) { - byte |= get_parity_bit(byte); + for (size_t i = 0; i < sizeof(KP18058_Settings); i++) { + settings_bytes[i] |= get_parity_bit(settings_bytes[i]); } // Send the I2C message