Skip to content

Commit 80d5508

Browse files
John DoeJohn Doe
authored andcommitted
fix I2C case where using different pins would not work with libs calling begin internally
if you call Wire.begin(new_sda, new_scl) and your library calls internally Wire.begin() this will overwrite the SDA,SCL pins to the default ones
1 parent 5baed40 commit 80d5508

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

libraries/Wire/Wire.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ TwoWire::TwoWire(){}
5555
// Public Methods //////////////////////////////////////////////////////////////
5656

5757
void TwoWire::begin(int sda, int scl){
58+
default_sda_pin = sda;
59+
default_scl_pin = scl;
5860
twi_init(sda, scl);
5961
flush();
6062
}

0 commit comments

Comments
 (0)