Remove SERIAL_PORT_2 code duplication

This commit is contained in:
Knutwurst
2021-11-03 09:31:01 +01:00
parent 09abca7bc7
commit d581c26db2
2 changed files with 2 additions and 4 deletions

View File

@@ -182,7 +182,6 @@
* :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000]
*/ */
#define BAUDRATE 250000 #define BAUDRATE 250000
#define BAUDRATE_2 500000 // For ESP8266
//#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate //#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate
/* EXP1 Header /* EXP1 Header
@@ -205,8 +204,8 @@
* Currently Ethernet (-2) is only supported on Teensy 4.1 boards. * Currently Ethernet (-2) is only supported on Teensy 4.1 boards.
* :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7] * :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
*/ */
//#define SERIAL_PORT_2 -1 //#define SERIAL_PORT_2 2 // For ESP8266
//#define BAUDRATE_2 250000 // Enable to override BAUDRATE #define BAUDRATE_2 500000 // For ESP8266
/** /**
* Select a third serial port on the board to use for communication with the host. * Select a third serial port on the board to use for communication with the host.

View File

@@ -1222,7 +1222,6 @@ void setup() {
#endif #endif
#define SETUP_RUN(C) do{ SETUP_LOG(STRINGIFY(C)); C; }while(0) #define SETUP_RUN(C) do{ SETUP_LOG(STRINGIFY(C)); C; }while(0)
MYSERIAL1.begin(BAUDRATE_2); // PATCH: Knutwurst
millis_t serial_connect_timeout = millis() + 1000UL; millis_t serial_connect_timeout = millis() + 1000UL;
while (!MYSERIAL1.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } while (!MYSERIAL1.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }