Skip to content

Commit 3585c58

Browse files
authored
Reset the SDA and SCL pins to INPUT at Wire.end() to prevent multiple pins connected to I2C when changing pins (earlephilhower#302)
1 parent a8121f3 commit 3585c58

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/Wire/src/Wire.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ void TwoWire::end() {
181181
return;
182182
}
183183
i2c_deinit(_i2c);
184+
pinMode(_sda, INPUT);
185+
pinMode(_scl, INPUT);
184186
_running = false;
185187
_txBegun = false;
186188
}

0 commit comments

Comments
 (0)