Skip to content

Commit cbaa368

Browse files
committed
call wire->end() only when set_active is true
1 parent 0e1fc6c commit cbaa368

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DriverPins.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ struct PinsI2C {
195195
AD_LOGI("Setting i2c clock: %u", frequency);
196196
p_wire->setClock(frequency);
197197
} else {
198-
AD_LOGI("I2C, not active, SDA, SCL, i2c clock not modified");
198+
AD_LOGI("I2C, not activated, SDA, SCL, i2c clock not modified");
199199
}
200200
return true;
201201
}
202202
void end() {
203203
#if !defined(ESP8266) && FORCE_WIRE_CLOSE
204-
p_wire->end();
204+
if (set_active) p_wire->end();
205205
#endif
206206
}
207207
};

0 commit comments

Comments
 (0)