I2C: allow any GPIO on 8266 (experimental)

as it turns out, also on 8266 any pin can be assigned to I2C. Only SPI pins are fixed, and GPIO16 should not be used as it does not support interrupts.
This commit is contained in:
Frank
2023-01-15 22:13:46 +01:00
parent 12cd6a2738
commit a320068bbe
4 changed files with 17 additions and 21 deletions

View File

@@ -310,6 +310,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
Wire.setPins(i2c_sda, i2c_scl); // this will fail if Wire is initilised (Wire.begin() called prior)
#endif
// Wire.begin(); // WLEDMM moved into pinManager
Serial.printf("pinmgr success for global i2c %d %d\n", i2c_sda, i2c_scl);
} else {
Serial.printf("pinmgr not success for global i2c %d %d\n", i2c_sda, i2c_scl);
}
@@ -324,6 +325,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
#else
SPI.begin();
#endif
Serial.printf("pinmgr success for global spi %d %d %d\n", spi_mosi, spi_miso, spi_sclk);
} else {
Serial.printf("pinmgr not success for global spi %d %d %d\n", spi_mosi, spi_miso, spi_sclk);
}