Skip to content

Commit

Permalink
fix downgradeability #2
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jun 7, 2024
1 parent f379e7a commit 7b9d016
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ conds:
- ["shelly.name", "ShellyPlus2PM-??????"]
- ["wifi.ap.ssid", "ShellyPlus2PM-??????"]
- ["i2c.enable", true]
- ["i2c.sda_gpio", 26]
- ["i2c.sda_gpio", 33]
- ["i2c.scl_gpio", 25]
- ["sw1", "sw", {title: "SW1 settings"}]
- ["sw1.name", "Shelly SW1"]
Expand Down
2 changes: 2 additions & 0 deletions src/ShellyPlus2PM/shelly_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ static Status PowerMeterInit(std::vector<std::unique_ptr<PowerMeter>> *pms) {
LOG(LL_INFO, ("Newer revision detected"));
if (mgos_sys_config_get_i2c_sda_gpio() != 26) {
mgos_sys_config_set_i2c_sda_gpio(26);
mgos_sys_config_save(&mgos_sys_config, false /* try_once */, NULL /* msg */);
}
reset_pin = 33;
} else {
if (mgos_sys_config_get_i2c_sda_gpio() != 33) {
mgos_sys_config_set_i2c_sda_gpio(33);
mgos_sys_config_save(&mgos_sys_config, false /* try_once */, NULL /* msg */);
}
reset_pin = 0; // unknown?
}
Expand Down

0 comments on commit 7b9d016

Please sign in to comment.