improvements for new MCU support (-S3/-S2/-C3)

- switch off debug messages to USBCDC, if WLED_DEBUG is not set
- ensure that analogread pins are valid - invalid pins cause lots of error messages and finally lead to watchdog reset on some MCUs.
This commit is contained in:
Frank
2022-12-10 19:16:02 +01:00
parent cafa78c3f3
commit 7ac8f6dd19
3 changed files with 46 additions and 16 deletions

View File

@@ -272,6 +272,9 @@ void WLED::setup()
#if defined(WLED_DEBUG) && defined(ARDUINO_ARCH_ESP32) && (defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || ARDUINO_USB_CDC_ON_BOOT)
delay(2500); // allow CDC USB serial to initialise
#endif
#if !defined(WLED_DEBUG) && defined(ARDUINO_ARCH_ESP32) && !defined(WLED_DEBUG_HOST) && ARDUINO_USB_CDC_ON_BOOT
Serial.setDebugOutput(false); // switch off kernel messages when using USBCDC
#endif
DEBUG_PRINTLN();
DEBUG_PRINT(F("---WLED "));
DEBUG_PRINT(versionString);