Skip to content

Commit

Permalink
fix: fix gpio function register typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmitty committed Aug 18, 2024
1 parent b48b77c commit 10dfac9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion esphome/components/mpq4242/mpq4242.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions esphome/components/mpq4242/mpq4242.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions esphome/components/mpq4242/sensor/mpq4242_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 10dfac9

Please sign in to comment.