提交 f0b79594 编写于 作者: M me-no-dev

add default pins for UART1 and UART2

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

thanks @Ladyada
上级 b5e0ebfc
......@@ -15,6 +15,14 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in
rxPin = 3;
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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册