Skip to content

Commit a40dc9b

Browse files
committed
Cosmetic change
1 parent c9f735f commit a40dc9b

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/wiring/m5_unit_unified_wiring.hpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
643643
inline 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

Comments
 (0)