mirror of
https://github.com/espressif/arduino-esp32
synced 2024-09-21 10:28:04 +00:00
Adds default Wire1 pins auto-setup (#7034)
This commit is contained in:
parent
943216308d
commit
852ea39ab1
@ -77,8 +77,12 @@ bool TwoWire::initPins(int sdaPin, int sclPin)
|
||||
}
|
||||
} else {
|
||||
if(sda==-1) {
|
||||
#ifdef WIRE1_PIN_DEFINED
|
||||
sdaPin = SDA1;
|
||||
#else
|
||||
log_e("no Default SDA Pin for Second Peripheral");
|
||||
return false; //no Default pin for Second Peripheral
|
||||
#endif
|
||||
} else {
|
||||
sdaPin = sda; // reuse prior pin
|
||||
}
|
||||
@ -94,8 +98,12 @@ bool TwoWire::initPins(int sdaPin, int sclPin)
|
||||
}
|
||||
} else {
|
||||
if(scl == -1) {
|
||||
#ifdef WIRE1_PIN_DEFINED
|
||||
sclPin = SCL1;
|
||||
#else
|
||||
log_e("no Default SCL Pin for Second Peripheral");
|
||||
return false; //no Default pin for Second Peripheral
|
||||
#endif
|
||||
} else {
|
||||
sclPin = scl; // reuse prior pin
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ static const uint8_t RX = 3;
|
||||
static const uint8_t SDA = 22;//23;
|
||||
static const uint8_t SCL = 21;//19;
|
||||
|
||||
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
|
||||
static const uint8_t SDA1 = 12;
|
||||
static const uint8_t SCL1 = 13;
|
||||
|
||||
|
@ -23,6 +23,7 @@ static const uint8_t RX = 7;
|
||||
static const uint8_t SDA = 4;
|
||||
static const uint8_t SCL = 33;
|
||||
|
||||
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
|
||||
static const uint8_t SDA1 = 22;
|
||||
static const uint8_t SCL1 = 19;
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
static const uint8_t SDA = 7;
|
||||
static const uint8_t SCL = 6;
|
||||
|
||||
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
|
||||
static const uint8_t SDA1 = 41;
|
||||
static const uint8_t SCL1 = 40;
|
||||
|
||||
|
@ -30,6 +30,7 @@ static const uint8_t RX = 16;
|
||||
static const uint8_t SDA = 7;
|
||||
static const uint8_t SCL = 6;
|
||||
|
||||
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
|
||||
static const uint8_t SDA1 = 41;
|
||||
static const uint8_t SCL1 = 40;
|
||||
|
||||
|
@ -21,6 +21,7 @@ static const uint8_t SDA = 21;
|
||||
static const uint8_t SCL = 22;
|
||||
static const uint8_t I2C_INT = 4;
|
||||
|
||||
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
|
||||
static const uint8_t SDA1 = 26;
|
||||
static const uint8_t SCL1 = 25;
|
||||
|
||||
|
@ -81,6 +81,7 @@ static const uint8_t OUTPUT2 = 27;
|
||||
static const uint8_t SDA0 = 21;
|
||||
static const uint8_t SCL0 = 22;
|
||||
|
||||
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
|
||||
static const uint8_t SDA1 = 4;
|
||||
static const uint8_t SCL1 = 5;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user