@@ -638,7 +638,7 @@ inline i2c_master_bus_handle_t ensureI2CBus(const i2c_port_t port, const gpio_nu
638638 cache[count].key = key;
639639 return cache[count++].handle ;
640640}
641- #else // legacy driver/i2c.h (IDF 5.0 / 5.1)
641+ #else // legacy driver/i2c.h (IDF 5.0 / 5.1)
642642// ! @brief Install the legacy I2C master driver once per {port, sda, scl}; cached so re-adds are no-ops.
643643inline bool ensureI2CLegacyDriver (const i2c_port_t port, const gpio_num_t sda, const gpio_num_t scl,
644644 const uint32_t clock)
@@ -656,14 +656,13 @@ inline bool ensureI2CLegacyDriver(const i2c_port_t port, const gpio_num_t sda, c
656656 return false ;
657657 }
658658 i2c_config_t conf{};
659- conf.mode = I2C_MODE_MASTER ;
660- conf.sda_io_num = sda;
661- conf.scl_io_num = scl;
662- conf.sda_pullup_en = true ;
663- conf.scl_pullup_en = true ;
659+ conf.mode = I2C_MODE_MASTER ;
660+ conf.sda_io_num = sda;
661+ conf.scl_io_num = scl;
662+ conf.sda_pullup_en = true ;
663+ conf.scl_pullup_en = true ;
664664 conf.master .clk_speed = clock;
665- if (i2c_param_config (port, &conf) != ESP_OK ||
666- i2c_driver_install (port, I2C_MODE_MASTER , 0 , 0 , 0 ) != ESP_OK ) {
665+ if (i2c_param_config (port, &conf) != ESP_OK || i2c_driver_install (port, I2C_MODE_MASTER , 0 , 0 , 0 ) != ESP_OK ) {
667666 M5_LIB_LOGE (" wiring: legacy i2c driver install failed port=%d sda=%d scl=%d" , (int )port, (int )sda, (int )scl);
668667 return false ;
669668 }
0 commit comments