@@ -276,10 +276,22 @@ void WLED::setup()
276276 #endif
277277
278278 Serial.begin (115200 );
279- Serial.setTimeout (50 );
280279 #if defined(WLED_DEBUG) && defined(ARDUINO_ARCH_ESP32) && (defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || ARDUINO_USB_CDC_ON_BOOT)
281280 delay (2500 ); // allow CDC USB serial to initialise
282281 #endif
282+
283+ #if ARDUINO_USB_CDC_ON_BOOT
284+ delay (2500 ); // WLEDMM: always allow CDC USB serial to initialise
285+ Serial.flush ();
286+ // Serial.setTimeout(350); // WLEDMM: don't change timeout, as it causes crashes later
287+ // WLEDMM: redirect debug output to HWCDC
288+ Serial0.setDebugOutput (false );
289+ Serial.setDebugOutput (true );
290+ #else
291+ Serial.setTimeout (50 );
292+ #endif
293+
294+ // Serial0.setDebugOutput(false);
283295 // Serial.setDebugOutput(true);
284296 USER_FLUSH (); delay (100 );
285297 USER_PRINTLN ();
@@ -362,14 +374,26 @@ void WLED::setup()
362374 pinManager.allocatePin (2 , true , PinOwner::DMX);
363375#endif
364376
377+ // WLEDMM experimental: support for single neoPixel on Adafruit boards
378+ #if 0
379+ //#ifdef PIN_NEOPIXEL
380+ //pinManager.allocatePin(PIN_NEOPIXEL, true, PinOwner::BusDigital);
381+ //#endif
382+ #ifdef NEOPIXEL_POWER
383+ pinManager.allocatePin(NEOPIXEL_POWER, true, PinOwner::Relay); // just to ensure this GPIO will not get used for other purposes
384+ pinMode(NEOPIXEL_POWER, OUTPUT);
385+ digitalWrite(NEOPIXEL_POWER, HIGH);
386+ #endif
387+ #endif
388+
365389 USER_PRINTLN ();
366390 DEBUG_PRINTLN (F (" Registering usermods ..." ));
367391 registerUsermods ();
368392
369393 for (uint8_t i=1 ; i<WLED_MAX_BUTTONS; i++) btnPin[i] = -1 ;
370394
371395 bool fsinit = false ;
372- DEBUG_PRINTLN (F (" Mount FS" ));
396+ USER_PRINTLN (F (" Mount FS" ));
373397#ifdef ARDUINO_ARCH_ESP32
374398 fsinit = WLED_FS.begin (true );
375399#else
@@ -386,6 +410,8 @@ void WLED::setup()
386410#endif
387411 updateFSInfo ();
388412
413+ USER_PRINTLN (F (" done Mounting FS" ));
414+
389415 // generate module IDs must be done before AP setup
390416 escapedMac = WiFi.macAddress ();
391417 escapedMac.replace (" :" , " " );
0 commit comments