Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 852ea39

Browse filesBrowse files
authored
Adds default Wire1 pins auto-setup (espressif#7034)
1 parent 9432163 commit 852ea39
Copy full SHA for 852ea39

File tree

Expand file treeCollapse file tree

7 files changed

+14
-0
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+14
-0
lines changed

‎libraries/Wire/src/Wire.cpp

Copy file name to clipboardExpand all lines: libraries/Wire/src/Wire.cpp
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@ bool TwoWire::initPins(int sdaPin, int sclPin)
7777
}
7878
} else {
7979
if(sda==-1) {
80+
#ifdef WIRE1_PIN_DEFINED
81+
sdaPin = SDA1;
82+
#else
8083
log_e("no Default SDA Pin for Second Peripheral");
8184
return false; //no Default pin for Second Peripheral
85+
#endif
8286
} else {
8387
sdaPin = sda; // reuse prior pin
8488
}
@@ -94,8 +98,12 @@ bool TwoWire::initPins(int sdaPin, int sclPin)
9498
}
9599
} else {
96100
if(scl == -1) {
101+
#ifdef WIRE1_PIN_DEFINED
102+
sclPin = SCL1;
103+
#else
97104
log_e("no Default SCL Pin for Second Peripheral");
98105
return false; //no Default pin for Second Peripheral
106+
#endif
99107
} else {
100108
sclPin = scl; // reuse prior pin
101109
}

‎variants/Microduino-esp32/pins_arduino.h

Copy file name to clipboardExpand all lines: variants/Microduino-esp32/pins_arduino.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ static const uint8_t RX = 3;
2626
static const uint8_t SDA = 22;//23;
2727
static const uint8_t SCL = 21;//19;
2828

29+
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
2930
static const uint8_t SDA1 = 12;
3031
static const uint8_t SCL1 = 13;
3132

‎variants/adafruit_qtpy_esp32/pins_arduino.h

Copy file name to clipboardExpand all lines: variants/adafruit_qtpy_esp32/pins_arduino.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ static const uint8_t RX = 7;
2323
static const uint8_t SDA = 4;
2424
static const uint8_t SCL = 33;
2525

26+
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
2627
static const uint8_t SDA1 = 22;
2728
static const uint8_t SCL1 = 19;
2829

‎variants/adafruit_qtpy_esp32s2/pins_arduino.h

Copy file name to clipboardExpand all lines: variants/adafruit_qtpy_esp32s2/pins_arduino.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
static const uint8_t SDA = 7;
3030
static const uint8_t SCL = 6;
3131

32+
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
3233
static const uint8_t SDA1 = 41;
3334
static const uint8_t SCL1 = 40;
3435

‎variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h

Copy file name to clipboardExpand all lines: variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ static const uint8_t RX = 16;
3030
static const uint8_t SDA = 7;
3131
static const uint8_t SCL = 6;
3232

33+
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
3334
static const uint8_t SDA1 = 41;
3435
static const uint8_t SCL1 = 40;
3536

‎variants/esp32micromod/pins_arduino.h

Copy file name to clipboardExpand all lines: variants/esp32micromod/pins_arduino.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static const uint8_t SDA = 21;
2121
static const uint8_t SCL = 22;
2222
static const uint8_t I2C_INT = 4;
2323

24+
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
2425
static const uint8_t SDA1 = 26;
2526
static const uint8_t SCL1 = 25;
2627

‎variants/openkb/pins_arduino.h

Copy file name to clipboardExpand all lines: variants/openkb/pins_arduino.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ static const uint8_t OUTPUT2 = 27;
8181
static const uint8_t SDA0 = 21;
8282
static const uint8_t SCL0 = 22;
8383

84+
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
8485
static const uint8_t SDA1 = 4;
8586
static const uint8_t SCL1 = 5;
8687

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.