add default pins for UART1 and UART2

NOTE: UART1's default pins can be used only when SPI Flash is DIO

thanks @ladyada
This commit is contained in:
me-no-dev 2016-11-13 17:01:44 +02:00
parent b5e0ebfc89
commit f0b7959425

View File

@ -15,6 +15,14 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in
rxPin = 3; rxPin = 3;
txPin = 1; txPin = 1;
} }
if(_uart_nr == 1 && rxPin < 0 && txPin < 0) {
rxPin = 9;
txPin = 10;
}
if(_uart_nr == 2 && rxPin < 0 && txPin < 0) {
rxPin = 16;
txPin = 17;
}
_uart = uartBegin(_uart_nr, baud, config, rxPin, txPin, 256, false); _uart = uartBegin(_uart_nr, baud, config, rxPin, txPin, 256, false);
} }