From 3a3853cfc7f9899e159b03ae224ea78a7defa496 Mon Sep 17 00:00:00 2001 From: TANAKA Masayuki Date: Thu, 15 May 2025 12:23:01 +0900 Subject: [PATCH 1/3] feat(core): Add wait time before setup Added initialization time for UART, etc. Default value is 0. --- cores/esp32/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cores/esp32/main.cpp b/cores/esp32/main.cpp index 6c4d50a9a84..9247a4dcb16 100644 --- a/cores/esp32/main.cpp +++ b/cores/esp32/main.cpp @@ -44,10 +44,15 @@ __attribute__((weak)) bool shouldPrintChipDebugReport(void) { return false; } +__attribute__((weak)) uint64_t getArduinoSetupWaitTick(void) { + return 0; +} + void loopTask(void *pvParameters) { #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL) // sets UART0 (default console) RX/TX pins as already configured in boot or as defined in variants/pins_arduino.h Serial0.setPins(gpioNumberToDigitalPin(SOC_RX0), gpioNumberToDigitalPin(SOC_TX0)); + vTaskDelay(getArduinoSetupWaitTick()); #endif #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG printBeforeSetupInfo(); From eaec282ac4bb63ab8d0fb0166a66f47c81bba9c6 Mon Sep 17 00:00:00 2001 From: TANAKA Masayuki Date: Thu, 15 May 2025 17:41:19 +0900 Subject: [PATCH 2/3] Update Arduino.h Add function definition and SET_SETUP_WAIT_TICH function --- cores/esp32/Arduino.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index 9048249a873..c95ab23cda6 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -228,6 +228,12 @@ bool shouldPrintChipDebugReport(void); return true; \ } +uint64_t getArduinoSetupWaitTick(void); +#define SET_SETUP_WAIT_TICH(tick) \ + uint64_t getArduinoSetupWaitTick() { \ + return tick; \ + } + // allows user to bypass esp_spiram_test() bool esp_psram_extram_test(void); #define BYPASS_SPIRAM_TEST(bypass) \ From 756bde2ee5dc45b94ab8ab86d75039d90c65194b Mon Sep 17 00:00:00 2001 From: TANAKA Masayuki Date: Thu, 15 May 2025 18:31:59 +0900 Subject: [PATCH 3/3] Update Arduino.h typo --- cores/esp32/Arduino.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index c95ab23cda6..b3a1be98cb6 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -229,7 +229,7 @@ bool shouldPrintChipDebugReport(void); } uint64_t getArduinoSetupWaitTick(void); -#define SET_SETUP_WAIT_TICH(tick) \ +#define SET_SETUP_WAIT_TICK(tick) \ uint64_t getArduinoSetupWaitTick() { \ return tick; \ }