forked from wled/WLED
-
-
Notifications
You must be signed in to change notification settings - Fork 123
Always allow proper serial console on S3/C3/C6/etc under ALL conditions #330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ff93a85
Always allow serial console on S3/C3/C6/etc
troyhacks 0514700
The rabbit said I was being too careful. Tested and works.
troyhacks ce0a556
Not from my PR but I'll fix it for the rabbit.
troyhacks a001bd1
Merge branch 'MoonModules:mdev' into mdev
troyhacks a5c6740
add P4, bring back lost comment
softhack007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,31 +26,37 @@ | |
| #if defined(ESP8266) || defined(ARDUINO_ARCH_ESP8266) | ||
| #error please fix your build environment. ESP32 and ESP8266 are both defined. | ||
| #endif | ||
| // only one of ARDUINO_ARCH_ESP32S2, ARDUINO_ARCH_ESP32S3, ARDUINO_ARCH_ESP32C3 allowed | ||
| #if defined(ARDUINO_ARCH_ESP32S3) && ( defined(ARDUINO_ARCH_ESP32S2) || defined(ARDUINO_ARCH_ESP32C3) ) | ||
| #error please fix your build environment. only one of ARDUINO_ARCH_ESP32S3, ARDUINO_ARCH_ESP32S2, ARDUINO_ARCH_ESP32C3 may be defined | ||
| // only one of ARDUINO_ARCH_ESP32S2, ARDUINO_ARCH_ESP32S3, ARDUINO_ARCH_ESP32C3, ARDUINO_ARCH_ESP32C6 allowed | ||
| #if defined(ARDUINO_ARCH_ESP32S3) && ( defined(ARDUINO_ARCH_ESP32S2) || defined(ARDUINO_ARCH_ESP32C3) || defined(ARDUINO_ARCH_ESP32C6) ) | ||
| #error please fix your build environment. only one of ARDUINO_ARCH_ESP32S3, ARDUINO_ARCH_ESP32S2, ARDUINO_ARCH_ESP32C3, ARDUINO_ARCH_ESP32C6 may be defined | ||
| #endif | ||
| #if defined(ARDUINO_ARCH_ESP32S2) && ( defined(ARDUINO_ARCH_ESP32S3) || defined(ARDUINO_ARCH_ESP32C3) ) | ||
| #error please fix your build environment. only one of ARDUINO_ARCH_ESP32S3, ARDUINO_ARCH_ESP32S2, ARDUINO_ARCH_ESP32C3 may be defined | ||
| #if defined(ARDUINO_ARCH_ESP32S2) && ( defined(ARDUINO_ARCH_ESP32S3) || defined(ARDUINO_ARCH_ESP32C3) || defined(ARDUINO_ARCH_ESP32C6) ) | ||
| #error please fix your build environment. only one of ARDUINO_ARCH_ESP32S3, ARDUINO_ARCH_ESP32S2, ARDUINO_ARCH_ESP32C3, ARDUINO_ARCH_ESP32C6 may be defined | ||
| #endif | ||
| #if defined(CONFIG_IDF_TARGET_ESP32) && ( defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)) | ||
| #if defined(ARDUINO_ARCH_ESP32C6) && ( defined(ARDUINO_ARCH_ESP32S3) || defined(ARDUINO_ARCH_ESP32S2) || defined(ARDUINO_ARCH_ESP32C3) ) | ||
| #error please fix your build environment. only one of ARDUINO_ARCH_ESP32S3, ARDUINO_ARCH_ESP32S2, ARDUINO_ARCH_ESP32C3, ARDUINO_ARCH_ESP32C6 may be defined | ||
| #endif | ||
| #if defined(CONFIG_IDF_TARGET_ESP32) && ( defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)) | ||
| #error please fix your build environment. only one CONFIG_IDF_TARGET may be defined | ||
| #endif | ||
| // make sure we have a supported CONFIG_IDF_TARGET_ | ||
| #if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) | ||
| #if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) | ||
| #error please fix your build environment. No supported CONFIG_IDF_TARGET was defined | ||
| #endif | ||
| #if CONFIG_IDF_TARGET_ESP32_SOLO || CONFIG_IDF_TARGET_ESP32SOLO | ||
| #warning ESP32 SOLO (single core) is not supported. | ||
| #endif | ||
| // only one of CONFIG_IDF_TARGET_ESP32, CONFIG_IDF_TARGET_ESP32S2, CONFIG_IDF_TARGET_ESP32S3, CONFIG_IDF_TARGET_ESP32C3 is allowed | ||
| #if defined(CONFIG_IDF_TARGET_ESP32) && ( defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)) | ||
| // only one of CONFIG_IDF_TARGET_ESP32, CONFIG_IDF_TARGET_ESP32S2, CONFIG_IDF_TARGET_ESP32S3, CONFIG_IDF_TARGET_ESP32C3, CONFIG_IDF_TARGET_ESP32C6 is allowed | ||
| #if defined(CONFIG_IDF_TARGET_ESP32) && ( defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)) | ||
| #error please fix your build environment. only one CONFIG_IDF_TARGET may be defined | ||
| #endif | ||
| #if defined(CONFIG_IDF_TARGET_ESP32S3) && ( defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)) | ||
| #error please fix your build environment. only one CONFIG_IDF_TARGET may be defined | ||
| #endif | ||
| #if defined(CONFIG_IDF_TARGET_ESP32S3) && ( defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)) | ||
| #if defined(CONFIG_IDF_TARGET_ESP32C3) && ( defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C6)) | ||
| #error please fix your build environment. only one CONFIG_IDF_TARGET may be defined | ||
| #endif | ||
| #if defined(CONFIG_IDF_TARGET_ESP32C3) && ( defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2)) | ||
| #if defined(CONFIG_IDF_TARGET_ESP32C6) && ( defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)) | ||
| #error please fix your build environment. only one CONFIG_IDF_TARGET may be defined | ||
| #endif | ||
|
|
||
|
|
@@ -466,13 +472,19 @@ void WLED::setup() | |
| #ifdef WLED_BOOTUPDELAY | ||
| delay(WLED_BOOTUPDELAY); // delay to let voltage stabilize, helps with boot issues on some setups | ||
| #endif | ||
|
|
||
| #if ARDUINO_USB_CDC_ON_BOOT && (defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32P4)) | ||
| Serial.begin(115200); // WLEDMM avoid "hung devices" when USB_CDC is enabled; see https://github.com/espressif/arduino-esp32/issues/9043 | ||
| Serial.setTxTimeoutMs(0); // potential side-effect: incomplete debug output, with missing characters whenever TX buffer is full. | ||
| #else | ||
| Serial.begin(115200); | ||
| #endif | ||
|
|
||
| #if !defined(WLEDMM_NO_SERIAL_WAIT) || defined(WLED_DEBUG) | ||
| #if !defined(WLEDMM_NO_SERIAL_WAIT) || defined(WLED_DEBUG) | ||
| if (!Serial) delay(1000); // WLEDMM make sure that Serial has initalized | ||
| #else | ||
| #else | ||
| if (!Serial) delay(300); // just a tiny wait to avoid problems later when acessing serial | ||
| #endif | ||
| #endif | ||
|
|
||
| init_math(); // WLEDMM: pre-calculate some lookup tables | ||
|
|
||
|
|
@@ -495,9 +507,9 @@ void WLED::setup() | |
| if (!Serial) delay(2500); // WLEDMM allow CDC USB serial to initialise (WLED_DEBUG only) | ||
| #endif | ||
| #if ARDUINO_USB_CDC_ON_BOOT || ARDUINO_USB_MODE | ||
| #if ARDUINO_USB_CDC_ON_BOOT && (defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)) | ||
| #if ARDUINO_USB_CDC_ON_BOOT && (defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32P4)) | ||
| // WLEDMM avoid "hung devices" when USB_CDC is enabled; see https://github.com/espressif/arduino-esp32/issues/9043 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @troyhacks you deleted the comments intentionally? or was this just a side-effect of AI work? |
||
| Serial.setTxTimeoutMs(0); // potential side-effect: incomplete debug output, with missing characters whenever TX buffer is full. | ||
| Serial.setTxTimeoutMs(0); | ||
| #endif | ||
| #if !defined(WLEDMM_NO_SERIAL_WAIT) || defined(WLED_DEBUG) | ||
| if (!Serial) delay(2500); // WLEDMM: always allow CDC USB serial to initialise | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.