Browse Source

Init serial ports first (#20944)

vanilla_fb_2.0.x
zeleps 4 years ago
committed by Scott Lahteine
parent
commit
e7658ec5f5
  1. 22
      Marlin/src/MarlinCore.cpp

22
Marlin/src/MarlinCore.cpp

@ -886,6 +886,17 @@ 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)
MYSERIAL0.begin(BAUDRATE);
millis_t serial_connect_timeout = millis() + 1000UL;
while (!MYSERIAL0.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
#if HAS_MULTI_SERIAL && !HAS_ETHERNET
MYSERIAL1.begin(BAUDRATE);
serial_connect_timeout = millis() + 1000UL;
while (!MYSERIAL1.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
#endif
SERIAL_ECHOLNPGM("start");
// Set up these pins early to prevent suicide // Set up these pins early to prevent suicide
#if HAS_KILL #if HAS_KILL
SETUP_LOG("KILL_PIN"); SETUP_LOG("KILL_PIN");
@ -918,17 +929,6 @@ void setup() {
#endif #endif
#endif #endif
MYSERIAL0.begin(BAUDRATE);
millis_t serial_connect_timeout = millis() + 1000UL;
while (!MYSERIAL0.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
#if HAS_MULTI_SERIAL && !HAS_ETHERNET
MYSERIAL1.begin(BAUDRATE);
serial_connect_timeout = millis() + 1000UL;
while (!MYSERIAL1.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
#endif
SERIAL_ECHOLNPGM("start");
#if BOTH(HAS_TFT_LVGL_UI, MKS_WIFI_MODULE) #if BOTH(HAS_TFT_LVGL_UI, MKS_WIFI_MODULE)
mks_esp_wifi_init(); mks_esp_wifi_init();
WIFISERIAL.begin(WIFI_BAUDRATE); WIFISERIAL.begin(WIFI_BAUDRATE);

Loading…
Cancel
Save