diff --git a/esphome/components/kp18058/kp18058.h b/esphome/components/kp18058/kp18058.h index ad70877656..dfb6a93cd0 100644 --- a/esphome/components/kp18058/kp18058.h +++ b/esphome/components/kp18058/kp18058.h @@ -75,7 +75,7 @@ class kp18058_output : public output::FloatOutput { * Constructor for the kp18058_output class. * Initializes the channel with default values. */ - kp18058_output() : parent_(nullptr), value_(0) {} + kp18058_output() : value_(0), parent_(nullptr) {} /** * Sets the parent kp18058 driver instance for this output channel. diff --git a/esphome/components/kp18058/softi2c.cpp b/esphome/components/kp18058/softi2c.cpp index 7df7248c22..faf9d5f454 100644 --- a/esphome/components/kp18058/softi2c.cpp +++ b/esphome/components/kp18058/softi2c.cpp @@ -8,7 +8,7 @@ static const uint8_t SOFT_I2C_CLOCK_TIME = 50; void ns_sleep(int ns_delay) { // Create a delay by executing NOP instructions in a loop. - for (volatile int i = 0; i < ns_delay; i++) + for (volatile int i = 0; i < ns_delay; i += 1) __asm__("nop"); }