From f4a2baa8d001bb66f18297af2a0f8aba0c90bd38 Mon Sep 17 00:00:00 2001 From: NewoPL <27411874+NewoPL@users.noreply.github.com> Date: Sun, 3 Nov 2024 12:46:14 +0100 Subject: [PATCH] [kp18058]: clang_tidy problems. this starts to be frustrating. --- esphome/components/kp18058/kp18058.cpp | 6 +++--- esphome/components/kp18058/kp18058_cfg.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/esphome/components/kp18058/kp18058.cpp b/esphome/components/kp18058/kp18058.cpp index a75ff654d1..e41ee3bfa6 100644 --- a/esphome/components/kp18058/kp18058.cpp +++ b/esphome/components/kp18058/kp18058.cpp @@ -60,7 +60,7 @@ void KP18058::program_led_driver() { }; // Create the settings struct - KP18058_Settings settings{}; + KP18058Settings settings{}; settings.address_identification = 1; settings.working_mode = all_channels_zero() ? STANDBY_MODE : RGBCW_MODE; @@ -91,13 +91,13 @@ void KP18058::program_led_driver() { // Calculate parity bits for each byte uint8_t *settings_bytes = reinterpret_cast(&settings); - for (size_t i = 0; i < sizeof(KP18058_Settings); i++) { + for (size_t i = 0; i < sizeof(KP18058Settings); i++) { settings_bytes[i] |= get_parity_bit(settings_bytes[i]); } // Send the I2C message i2c_.start(); - for (size_t i = 0; i < sizeof(KP18058_Settings); i++) { + for (size_t i = 0; i < sizeof(KP18058Settings); i++) { // On error, try to repeat the byte transmission I2C_MAX_RETRY times bool write_succeeded; for (int attempt = 0; attempt < I2C_MAX_RETRY; attempt++) { diff --git a/esphome/components/kp18058/kp18058_cfg.h b/esphome/components/kp18058/kp18058_cfg.h index 0f519255fb..15e6a1493d 100644 --- a/esphome/components/kp18058/kp18058_cfg.h +++ b/esphome/components/kp18058/kp18058_cfg.h @@ -94,7 +94,7 @@ enum CDFrequency : uint8_t { /** * @brief the structure of the I2C message for configuring the KP18058 LED driver settings. */ -struct KP18058_Settings { +struct KP18058Settings { // Byte 0 uint8_t byte0_parity_bit : 1; uint8_t start_byte_address : 4; @@ -132,8 +132,8 @@ struct KP18058_Settings { #pragma pack(pop) -// Ensures that KP18058_Settings size is exactly 14 bytes during compilation -static_assert(sizeof(KP18058_Settings) == 14, "Size of KP18058_Settings must be exactly 14 bytes"); +// Ensures that KP18058Settings size is exactly 14 bytes during compilation +static_assert(sizeof(KP18058Settings) == 14, "Size of KP18058Settings must be exactly 14 bytes"); } // namespace kp18058 } // namespace esphome