diff --git a/esphome/components/mpq4242/mpq4242.cpp b/esphome/components/mpq4242/mpq4242.cpp index 769dc08..e84e3f6 100644 --- a/esphome/components/mpq4242/mpq4242.cpp +++ b/esphome/components/mpq4242/mpq4242.cpp @@ -76,7 +76,7 @@ void MPQ4242Component::setup() { } // Set GPIO functions - i2c::I2CRegister CTL_SYS2 = reg(MPQ4242_REGISTER_CTL_SYS17); + i2c::I2CRegister CTL_SYS2 = reg(MPQ4242_REGISTER_CTL_SYS2); // GPIO1 bits[7:5], GPIO2 bits[4:2] CTL_SYS2 |= (this->gpio1_function_ << 5) | (this->gpio2_function_ << 2); } diff --git a/esphome/components/mpq4242/mpq4242.h b/esphome/components/mpq4242/mpq4242.h index 982731d..b306ffb 100644 --- a/esphome/components/mpq4242/mpq4242.h +++ b/esphome/components/mpq4242/mpq4242.h @@ -81,6 +81,7 @@ static const uint8_t MPQ4242_REGISTER_PD_CTL2 = 0x17; static const uint8_t MPQ4242_REGISTER_PWR_CTL1 = 0x18; static const uint8_t MPQ4242_REGISTER_PWR_CTL2 = 0x19; static const uint8_t MPQ4242_REGISTER_CTL_SYS1 = 0x1E; +static const uint8_t MPQ4242_REGISTER_CTL_SYS2 = 0x1F; static const uint8_t MPQ4242_REGISTER_CTL_SYS16 = 0x2D; static const uint8_t MPQ4242_REGISTER_CTL_SYS17 = 0x2E; static const uint8_t MPQ4242_REGISTER_STATUS1 = 0x30; diff --git a/esphome/components/mpq4242/sensor/mpq4242_sensor.h b/esphome/components/mpq4242/sensor/mpq4242_sensor.h index 1e77254..42b63ec 100644 --- a/esphome/components/mpq4242/sensor/mpq4242_sensor.h +++ b/esphome/components/mpq4242/sensor/mpq4242_sensor.h @@ -59,13 +59,6 @@ class MPQ4242Sensor : public PollingComponent { protected: MPQ4242Component *parent_; - /* - i2c::I2CRegister FW_REV; - i2c::I2CRegister MAX_REQ_CUR; - i2c::I2CRegister PWR_CTL2; - i2c::I2CRegister STATUS2; - i2c::I2CRegister STATUS3; - */ i2c::I2CRegister FW_REV = this->parent_->reg(MPQ4242_REGISTER_FW_REV); i2c::I2CRegister MAX_REQ_CUR = this->parent_->reg(MPQ4242_REGISTER_MAX_REQ_CUR); i2c::I2CRegister PWR_CTL2 = this->parent_->reg(MPQ4242_REGISTER_PWR_CTL2);