Skip to content

Commit 1bf6318

Browse files
committed
add default pins for UARTs #1 and #2 so you can just Serial1.begin(baud)
1 parent 871f28e commit 1bf6318

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: cores/esp32/HardwareSerial.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in
1515
rxPin = 3;
1616
txPin = 1;
1717
}
18+
if(_uart_nr == 1 && rxPin < 0 && txPin < 0) {
19+
rxPin = 9;
20+
txPin = 10;
21+
}
22+
if(_uart_nr == 2 && rxPin < 0 && txPin < 0) {
23+
rxPin = 16;
24+
txPin = 17;
25+
}
1826
_uart = uartBegin(_uart_nr, baud, config, rxPin, txPin, 256, false);
1927
}
2028

0 commit comments

Comments
 (0)