feat(core): Add wait time before setup#11367
Conversation
Added initialization time for UART, etc. Default value is 0.
👋 Hello tanakamasayuki, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 76 files 76 suites 13m 13s ⏱️ Results for commit a77a94b. ♻️ This comment has been updated with latest results. |
Add function definition and SET_SETUP_WAIT_TICH function
typo
|
Please do not add weak defines. There are two open issues where weak defines generate weird issues. |
|
Thank you for your reply. [memo] projects/build_opt.h main.cpp #if defined(ARDUINO_SETUP_WAIT_TIME)
// set the delay time before running setup in build_opt.h
vTaskDelay(ARDUINO_SETUP_WAIT_TIME);
#endifRestarting the Arduino IDE did not recompile main.cpp. |
|
Rename to |
Reasons there were/are different. |
|
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new feature to allow a configurable wait time before sketch execution, giving users time to open the Serial Monitor and catch the initialization messages.
- Adds a macro and function (getArduinoSetupWaitTime_ms) to enable a configurable delay before setup().
- Updates the main loop task to use the new wait time.
- Provides an example sketch to demonstrate the feature.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| libraries/ESP32/examples/ArduinoWaitTimeBeforeStartingSketch/ArduinoWaitTimeBeforeStartingSketch.ino | Demonstrates use of the wait time macro with a 5-second delay before starting. |
| cores/esp32/main.cpp | Updates loopTask to delay execution using getArduinoSetupWaitTime_ms. |
| cores/esp32/Arduino.h | Adds the macro SET_TIME_BEFORE_STARTING_SKETCH_MS and declares getArduinoSetupWaitTime_ms. |
Comments suppressed due to low confidence (1)
cores/esp32/Arduino.h:234
- Consider marking the function definition inside the macro as 'inline' (or 'static inline') to avoid potential multiple definition issues when included in multiple source files.
#define SET_TIME_BEFORE_STARTING_SKETCH_MS(time_ms) \
|
@tanakamasayuki - thank you for the contribution! |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@me-no-dev @P-R-O-C-H-Y @lucasssvaz - This feature may be interesting for debuging with CDC . I had a few problems reading logs when using TimyUSB CDC for the S2 and S3. When I reset the SoC and try to read the logs after enumeration and opening a terminal, messages are already gone. |
Description of Change
Added initialization time for UART, etc.
Default value is 0.
Tests scenarios
Arduino-esp32 core v3.2.0 with M5STACK_STICKC_PLUS2 Board
now or default
output
Output is cut off because UART is not yet initialized.
set wait
output
All output.