We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bf8961 commit 0a5b435Copy full SHA for 0a5b435
src/src/Helpers/Hardware.cpp
@@ -173,7 +173,6 @@ void initI2C() {
173
}
174
addLog(LOG_LEVEL_INFO, F("INIT : I2C"));
175
I2CSelectClockSpeed(false); // Set normal clock speed
176
- Wire.begin(Settings.Pin_i2c_sda, Settings.Pin_i2c_scl);
177
178
if (Settings.WireClockStretchLimit)
179
{
@@ -226,8 +225,13 @@ void I2CSelectClockSpeed(bool setLowSpeed) {
226
225
// No need to change the clock speed.
227
return;
228
229
- lastI2CClockSpeed = newI2CClockSpeed;
+ lastI2CClockSpeed = newI2CClockSpeed;
+ #ifdef ESP32
230
+ Wire.begin(Settings.Pin_i2c_sda, Settings.Pin_i2c_scl, newI2CClockSpeed);
231
+ #else
232
+ Wire.begin(Settings.Pin_i2c_sda, Settings.Pin_i2c_scl);
233
Wire.setClock(newI2CClockSpeed);
234
+ #endif
235
236
237
#ifdef FEATURE_I2CMULTIPLEXER
0 commit comments