Fix clang-format violations

This commit is contained in:
Daniel Whitlow 2024-07-13 00:50:38 -07:00
parent f6caf6e1ac
commit ba14c78193

View file

@ -50,13 +50,14 @@ void IDFI2CBus::setup() {
ESP_LOGW(TAG, "i2c timeout of %" PRIu32 "us greater than max of 13ms on esp-idf, setting to max", timeout_); ESP_LOGW(TAG, "i2c timeout of %" PRIu32 "us greater than max of 13ms on esp-idf, setting to max", timeout_);
timeout_ = 13000; timeout_ = 13000;
} }
err = i2c_set_timeout(port_, timeout_ / (APB_CLK_FREQ / 1000000)); uint32_t timeout_ticks = timeout_ / (APB_CLK_FREQ / 1000000);
err = i2c_set_timeout(port_, timeout_ticks);
if (err != ESP_OK) { if (err != ESP_OK) {
ESP_LOGW(TAG, "i2c_set_timeout failed: %s", esp_err_to_name(err)); ESP_LOGW(TAG, "i2c_set_timeout failed: %s", esp_err_to_name(err));
this->mark_failed(); this->mark_failed();
return; return;
} else { } else {
ESP_LOGV(TAG, "i2c_timeout set to %" PRIu32 " ticks (%" PRIu32 " us)", timeout_ / (APB_CLK_FREQ / 1000000), timeout_); ESP_LOGV(TAG, "i2c_timeout set to %" PRIu32 " ticks (%" PRIu32 " us)", timeout_ticks, timeout_);
} }
} }
err = i2c_driver_install(port_, I2C_MODE_MASTER, 0, 0, ESP_INTR_FLAG_IRAM); err = i2c_driver_install(port_, I2C_MODE_MASTER, 0, 0, ESP_INTR_FLAG_IRAM);