Skip to content

Commit

Permalink
i2cdev: fixed driver reinstallation as in #49
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleRus committed Mar 14, 2020
1 parent 0868d6c commit 1d8ea2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/i2cdev/i2cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ static esp_err_t i2c_setup_port(i2c_port_t port, const i2c_config_t *cfg)

if (installed)
i2c_driver_delete(port);
if ((res = i2c_param_config(port, &temp)) != ESP_OK)
return res;
#if HELPER_TARGET_IS_ESP32
if ((res = i2c_driver_install(port, temp.mode, 0, 0, 0)) != ESP_OK)
return res;
#elif HELPER_TARGET_IS_ESP8266
if ((res = i2c_driver_install(port, temp.mode)) != ESP_OK)
return res;
#endif
if ((res = i2c_param_config(port, &temp)) != ESP_OK)
return res;
installed = true;

memcpy(&configs[port], &temp, sizeof(i2c_config_t));
Expand Down

0 comments on commit 1d8ea2d

Please sign in to comment.