From 8c2a4a3a3aaa9832fa40874a24cf917b589e9be5 Mon Sep 17 00:00:00 2001 From: John Doe Date: Sat, 20 Jun 2015 21:57:09 +0300 Subject: [PATCH] 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 --- hardware/esp8266com/esp8266/libraries/Wire/Wire.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hardware/esp8266com/esp8266/libraries/Wire/Wire.cpp b/hardware/esp8266com/esp8266/libraries/Wire/Wire.cpp index 03901583c..759159203 100644 --- a/hardware/esp8266com/esp8266/libraries/Wire/Wire.cpp +++ b/hardware/esp8266com/esp8266/libraries/Wire/Wire.cpp @@ -55,6 +55,8 @@ TwoWire::TwoWire(){} // Public Methods ////////////////////////////////////////////////////////////// void TwoWire::begin(int sda, int scl){ + default_sda_pin = sda; + default_scl_pin = scl; twi_init(sda, scl); flush(); }