Skip to content
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

feat(uart) 3.1.x Core: fixes serialEventRun() to avoid calling available() if serialEvent() is not declared #10428

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

SuGlider
Copy link
Collaborator

@SuGlider SuGlider commented Oct 7, 2024

Description of Change

loop() calls Serial Events functions when those are declared.
The way it was declared, was forcing to always call avalable() to then call an empty function.
This commit fixes it.

Now when the sketch has no serialEvent() function declared, it won't be executed neither will available().
There are is a performance degradation when calling available() every single time when loop() was executed, whenever Serial.begin() is executed.

It shall be merged to 3.0.x and 3.1.x

Tests scenarios

uint32_t  Loopcounter = 0;
static uint32_t msTick;      

void setup() 
{
 Serial.begin(115200);                     // Setup the serial port to 115200 baud //
 msTick = millis(); 

 Serial0.begin(115200); // THIS Line starts UART Arduino Driver and also forces to executing serialEventRun() that "eats" CPU time...
}

void loop() 
{
 Loopcounter++;
 EverySecondCheck();
}

//--------------------------------------------//
// COMMON Update routine done every second
//--------------------------------------------
void EverySecondCheck(void)
{
 uint32_t msLeap = millis() - msTick;     // 
 if (msLeap >999)                         // Every second enter the loop
 {
  msTick = millis();
 Serial.printf("Loops per second: %u\n",Loopcounter);
 Loopcounter = 0;
 }  
}

Related links

Closes #10397

loop() calls Serial Events functions when those are declared. The way it was declared was forcing to alway call avalable() to then call an empty function. This commit fixes it.
@SuGlider SuGlider added this to the 3.0.5 milestone Oct 7, 2024
@SuGlider SuGlider self-assigned this Oct 7, 2024
Copy link
Contributor

github-actions bot commented Oct 7, 2024

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "feat(uart): eliminates nonexistent functions":
    • body's lines must not be longer than 100 characters

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

👋 Hello SuGlider, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 07b2e1d

Copy link
Contributor

github-actions bot commented Oct 7, 2024

Test Results

 56 files   56 suites   4m 12s ⏱️
 21 tests  21 ✅ 0 💤 0 ❌
135 runs  135 ✅ 0 💤 0 ❌

Results for commit 07b2e1d.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Oct 7, 2024

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.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32S3💚 -28‼️ +2091K0.00‼️ +215.090‼️ +15K0.00‼️ +26.21
ESP32S2💚 -16‼️ +4K0.00⚠️ +0.390⚠️ +240.00⚠️ +0.05
ESP32C30⚠️ +220.00⚠️ +0.01000.000.00
ESP32C60⚠️ +220.00⚠️ +0.01000.000.00
ESP32H20⚠️ +220.00⚠️ +0.01000.000.00
ESP32💚 -24‼️ +11K0.00‼️ +1.120⚠️ +640.00⚠️ +0.11
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
ArduinoOTA/examples/BasicOTA00💚 -40⚠️ +160⚠️ +160--💚 -120
AsyncUDP/examples/AsyncUDPClient💚 -280💚 -40⚠️ +160⚠️ +160--00
AsyncUDP/examples/AsyncUDPMulticastServer00💚 -40⚠️ +160⚠️ +160--00
AsyncUDP/examples/AsyncUDPServer00💚 -40⚠️ +160⚠️ +160--00
BLE/examples/BLE5_extended_scan00--⚠️ +160⚠️ +160⚠️ +160--
BLE/examples/BLE5_multi_advertising00--⚠️ +160⚠️ +160⚠️ +180--
BLE/examples/BLE5_periodic_advertising💚 -40--⚠️ +160⚠️ +160⚠️ +180--
BLE/examples/BLE5_periodic_sync00--⚠️ +160⚠️ +160⚠️ +180--
BLE/examples/Beacon_Scanner00--⚠️ +160⚠️ +160⚠️ +16000
BLE/examples/Client00--⚠️ +160⚠️ +160⚠️ +16000
BLE/examples/EddystoneTLM_Beacon00--⚠️ +160⚠️ +160⚠️ +16000
BLE/examples/EddystoneURL_Beacon00--⚠️ +160⚠️ +160⚠️ +16000
BLE/examples/Notify00--⚠️ +160⚠️ +160⚠️ +16000
BLE/examples/Scan00--⚠️ +160⚠️ +160⚠️ +16000
BLE/examples/Server💚 -40--⚠️ +160⚠️ +160⚠️ +18000
BLE/examples/Server_multiconnect00--⚠️ +160⚠️ +160⚠️ +16000
BLE/examples/UART00--⚠️ +160⚠️ +160⚠️ +16000
BLE/examples/Write00--⚠️ +180⚠️ +180⚠️ +18000
BLE/examples/iBeacon00--⚠️ +160⚠️ +160⚠️ +160💚 -40
DNSServer/examples/CaptivePortal💚 -40💚 -40⚠️ +160⚠️ +160--00
EEPROM/examples/eeprom_class⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
EEPROM/examples/eeprom_extra⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
EEPROM/examples/eeprom_write⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/AnalogOut/LEDCFade⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/AnalogOut/LEDCSingleChannel⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/AnalogOut/LEDCSoftwareFade⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/AnalogOut/SigmaDelta⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/AnalogOut/ledcFrequency⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/AnalogOut/ledcWrite_RGB⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/AnalogRead⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/AnalogReadContinuous⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/ArduinoStackSize⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/CI/CIBoardsTest⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/Camera/CameraWebServer‼️ +2091K‼️ +15K‼️ +4K⚠️ +24------‼️ +11K⚠️ +64
ESP32/examples/ChipID/GetChipID⚠️ +40⚠️ +40⚠️ +200⚠️ +180⚠️ +200⚠️ +40
ESP32/examples/DeepSleep/ExternalWakeUp⚠️ +40⚠️ +40------⚠️ +40
ESP32/examples/DeepSleep/TimerWakeUp⚠️ +40⚠️ +40⚠️ +200⚠️ +180--⚠️ +40
ESP32/examples/DeepSleep/TouchWakeUp⚠️ +40⚠️ +40------⚠️ +40
ESP32/examples/FreeRTOS/BasicMultiThreading⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +180⚠️ +40
ESP32/examples/FreeRTOS/Mutex⚠️ +40⚠️ +40⚠️ +200⚠️ +220⚠️ +200⚠️ +40
ESP32/examples/FreeRTOS/Queue⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/FreeRTOS/Semaphore⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/GPIO/BlinkRGB⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/GPIO/FunctionalInterrupt⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/GPIO/FunctionalInterruptStruct⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/GPIO/GPIOInterrupt⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/HWCDC_Events⚠️ +40--⚠️ +200⚠️ +200⚠️ +200--
ESP32/examples/MacAddress/GetMacAddress⚠️ +40⚠️ +40⚠️ +200⚠️ +180⚠️ +200⚠️ +40
ESP32/examples/RMT/Legacy_RMT_Driver_Compatible⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/RMT/RMTCallback⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/RMT/RMTLoopback⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/RMT/RMTReadXJT⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +220⚠️ +40
ESP32/examples/RMT/RMTWrite_RGB_LED⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/RMT/RMT_CPUFreq_Test⚠️ +40⚠️ +40⚠️ +220⚠️ +220⚠️ +200⚠️ +40
ESP32/examples/RMT/RMT_EndOfTransmissionState⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/RMT/RMT_LED_Blink⚠️ +40⚠️ +40⚠️ +220⚠️ +200⚠️ +160⚠️ +40
ESP32/examples/ResetReason/ResetReason⚠️ +40⚠️ +40⚠️ +200⚠️ +180⚠️ +200⚠️ +40
ESP32/examples/ResetReason/ResetReason2⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/Serial/BaudRateDetect_Demo⚠️ +40⚠️ +40⚠️ +200⚠️ +180⚠️ +200⚠️ +40
ESP32/examples/Serial/OnReceiveError_BREAK_Demo00⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/Serial/OnReceive_Demo00⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/Serial/RS485_Echo_Demo⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/Serial/RxFIFOFull_Demo00⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/Serial/RxTimeout_Demo00⚠️ +40⚠️ +220⚠️ +220⚠️ +200⚠️ +40
ESP32/examples/Serial/Serial_All_CPU_Freqs⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +220⚠️ +40
ESP32/examples/Serial/Serial_STD_Func_OnReceive⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/Serial/onReceiveExample⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/TWAI/TWAIreceive⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +220⚠️ +40
ESP32/examples/TWAI/TWAItransmit⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +180⚠️ +40
ESP32/examples/Template/ExampleTemplate⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/Time/SimpleTime00💚 -40⚠️ +200⚠️ +200--💚 -240
ESP32/examples/Timer/RepeatTimer⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +180⚠️ +40
ESP32/examples/Timer/WatchdogTimer⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/Touch/TouchButtonV2⚠️ +40⚠️ +40--------
ESP32/examples/Touch/TouchInterrupt⚠️ +40⚠️ +40------⚠️ +40
ESP32/examples/Touch/TouchRead⚠️ +40⚠️ +40------⚠️ +40
ESP32/examples/Utilities/HEXBuilder⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP32/examples/Utilities/MD5Builder⚠️ +40⚠️ +40⚠️ +220⚠️ +220⚠️ +220⚠️ +40
ESP32/examples/Utilities/SHA1Builder⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP_I2S/examples/ES8388_loopback⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
ESP_I2S/examples/Record_to_WAV⚠️ +40--------⚠️ +40
ESP_I2S/examples/Simple_tone⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
ESP_NOW/examples/ESP_NOW_Broadcast_Master💚 -12000⚠️ +200⚠️ +200--00
ESP_NOW/examples/ESP_NOW_Broadcast_Slave00⚠️ +40⚠️ +200⚠️ +200--00
ESP_NOW/examples/ESP_NOW_Network💚 -120💚 -40⚠️ +160⚠️ +160--00
ESP_NOW/examples/ESP_NOW_Serial00💚 -40⚠️ +200⚠️ +200--00
ESP_SR/examples/Basic⚠️ +40----------
ESPmDNS/examples/mDNS-SD_Extended💚 -12000⚠️ +200⚠️ +200--00
ESPmDNS/examples/mDNS_Web_Server00💚 -40⚠️ +160⚠️ +160--00
Ethernet/examples/ETH_W5500_Arduino_SPI⚠️ +40⚠️ +40⚠️ +180⚠️ +180⚠️ +180⚠️ +40
Ethernet/examples/ETH_W5500_IDF_SPI⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
Ethernet/examples/ETH_WIFI_BRIDGE00💚 -40⚠️ +160⚠️ +160--00
FFat/examples/FFat_Test⚠️ +40⚠️ +40⚠️ +200⚠️ +180⚠️ +200⚠️ +40
FFat/examples/FFat_time00💚 -40⚠️ +160⚠️ +160--00
HTTPClient/examples/Authorization00💚 -40⚠️ +160⚠️ +160--💚 -120
HTTPClient/examples/BasicHttpClient00💚 -40⚠️ +160⚠️ +160--💚 -120
HTTPClient/examples/BasicHttpsClient00💚 -40⚠️ +160⚠️ +160--00
HTTPClient/examples/HTTPClientEnterprise💚 -160💚 -40⚠️ +160⚠️ +160--00
HTTPClient/examples/ReuseConnection00💚 -40⚠️ +160⚠️ +160--00
HTTPClient/examples/StreamHttpClient00💚 -40⚠️ +160⚠️ +160--00
HTTPUpdate/examples/httpUpdate00💚 -40⚠️ +160⚠️ +160--00
HTTPUpdate/examples/httpUpdateSPIFFS💚 -12000⚠️ +160⚠️ +160--00
HTTPUpdate/examples/httpUpdateSecure00⚠️ +40⚠️ +160⚠️ +160--💚 -40
HTTPUpdateServer/examples/WebUpdater0000⚠️ +160⚠️ +160--00
Insights/examples/DiagnosticsSmokeTest00💚 -40⚠️ +200⚠️ +200--00
Insights/examples/MinimalDiagnostics00💚 -40⚠️ +200⚠️ +200--00
LittleFS/examples/LITTLEFS_test⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
LittleFS/examples/LITTLEFS_time00💚 -40⚠️ +160⚠️ +160--💚 -120
NetBIOS/examples/ESP_NBNST00💚 -40⚠️ +160⚠️ +160--00
NetworkClientSecure/examples/WiFiClientInsecure0000⚠️ +160⚠️ +160--00
NetworkClientSecure/examples/WiFiClientPSK00💚 -40⚠️ +160⚠️ +160--00
NetworkClientSecure/examples/WiFiClientSecure💚 -160💚 -40⚠️ +160⚠️ +160--00
NetworkClientSecure/examples/WiFiClientSecureEnterprise00💚 -40⚠️ +160⚠️ +160--00
NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade00💚 -40⚠️ +160⚠️ +160--00
NetworkClientSecure/examples/WiFiClientShowPeerCredentials00💚 -40⚠️ +160⚠️ +160--💚 -40
NetworkClientSecure/examples/WiFiClientTrustOnFirstUse00💚 -120⚠️ +160⚠️ +160--00
PPP/examples/PPP_Basic⚠️ +40⚠️ +40⚠️ +180⚠️ +180⚠️ +180⚠️ +40
PPP/examples/PPP_WIFI_BRIDGE0000⚠️ +160⚠️ +160--00
Preferences/examples/Prefs2Struct⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
Preferences/examples/StartCounter⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
RainMaker/examples/RMakerCustom0000⚠️ +200⚠️ +200--💚 -120
RainMaker/examples/RMakerCustomAirCooler00💚 -40⚠️ +200⚠️ +200--00
RainMaker/examples/RMakerSonoffDualR300💚 -40⚠️ +200⚠️ +200--💚 -160
RainMaker/examples/RMakerSwitch00💚 -40⚠️ +180⚠️ +180--00
SD/examples/SD_Test⚠️ +40⚠️ +40⚠️ +160⚠️ +160⚠️ +160⚠️ +40
SD/examples/SD_time00💚 -40⚠️ +160⚠️ +160--00
SD_MMC/examples/SD2USBMSC⚠️ +40----------
SD_MMC/examples/SDMMC_Test⚠️ +40--------⚠️ +40
SD_MMC/examples/SDMMC_time💚 -40--------00
SPI/examples/SPI_Multiple_Buses⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
SPIFFS/examples/SPIFFS_Test⚠️ +40⚠️ +40⚠️ +200⚠️ +180⚠️ +200⚠️ +40
SPIFFS/examples/SPIFFS_time💚 -40💚 -40⚠️ +160⚠️ +160--00
SimpleBLE/examples/SimpleBleDevice00--⚠️ +200⚠️ +200⚠️ +20000
TFLiteMicro/examples/hello_world⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
Ticker/examples/Blinker⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
Ticker/examples/TickerBasic⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
Ticker/examples/TickerParameter⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
USB/examples/CompositeDevice⚠️ +40⚠️ +40--------
USB/examples/ConsumerControl⚠️ +40⚠️ +40--------
USB/examples/CustomHIDDevice⚠️ +40⚠️ +40--------
USB/examples/FirmwareMSC⚠️ +40⚠️ +40--------
USB/examples/Gamepad⚠️ +40⚠️ +40--------
USB/examples/HIDVendor⚠️ +40⚠️ +40--------
USB/examples/Keyboard/KeyboardLogout⚠️ +40⚠️ +40--------
USB/examples/Keyboard/KeyboardMessage⚠️ +40⚠️ +40--------
USB/examples/Keyboard/KeyboardReprogram⚠️ +40⚠️ +40--------
USB/examples/Keyboard/KeyboardSerial⚠️ +40⚠️ +40--------
USB/examples/KeyboardAndMouseControl⚠️ +40⚠️ +40--------
USB/examples/MIDI/MidiController⚠️ +40⚠️ +40--------
USB/examples/MIDI/MidiInterface⚠️ +40⚠️ +40--------
USB/examples/MIDI/MidiMusicBox⚠️ +40⚠️ +40--------
USB/examples/MIDI/ReceiveMidi⚠️ +40⚠️ +40--------
USB/examples/Mouse/ButtonMouseControl⚠️ +40⚠️ +40--------
USB/examples/SystemControl⚠️ +40⚠️ +40--------
USB/examples/USBMSC⚠️ +40⚠️ +40--------
USB/examples/USBSerial⚠️ +40⚠️ +40--------
USB/examples/USBVendor⚠️ +40⚠️ +40--------
Update/examples/AWS_S3_OTA_Update00💚 -40⚠️ +160⚠️ +160--00
Update/examples/HTTPS_OTA_Update00💚 -40⚠️ +180⚠️ +200--00
Update/examples/HTTP_Client_AES_OTA_Update00💚 -40⚠️ +160⚠️ +160--💚 -160
Update/examples/HTTP_Server_AES_OTA_Update💚 -4000⚠️ +160⚠️ +160--00
Update/examples/OTAWebUpdater0000⚠️ +160⚠️ +160--00
Update/examples/SD_Update⚠️ +40⚠️ +40⚠️ +160⚠️ +160⚠️ +160⚠️ +40
WebServer/examples/AdvancedWebServer00💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/FSBrowser💚 -40💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/Filters💚 -40💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/HelloServer00💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/HttpAdvancedAuth00💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/HttpAuthCallback00💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/HttpAuthCallbackInline💚 -160💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/HttpBasicAuth00💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/HttpBasicAuthSHA100💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/HttpBasicAuthSHA1orBearerToken00💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/MultiHomedServers00💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/PathArgServer💚 -120💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/SDWebServer00💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/SimpleAuthentification00💚 -40⚠️ +160⚠️ +160--💚 -40
WebServer/examples/UploadHugeFile00💚 -40⚠️ +160⚠️ +160--00
WebServer/examples/WebServer00💚 -120⚠️ +160⚠️ +160--00
WebServer/examples/WebUpdate00💚 -40⚠️ +160⚠️ +160--00
WiFi/examples/FTM/FTM_Initiator00💚 -40⚠️ +200⚠️ +200--00
WiFi/examples/FTM/FTM_Responder00💚 -40⚠️ +200⚠️ +180--00
WiFi/examples/SimpleWiFiServer00💚 -40⚠️ +160⚠️ +160--00
WiFi/examples/WPS00💚 -40⚠️ +200⚠️ +200--00
WiFi/examples/WiFiAccessPoint00💚 -40⚠️ +160⚠️ +160--00
WiFi/examples/WiFiBlueToothSwitch00--⚠️ +200⚠️ +200--00
WiFi/examples/WiFiClient00💚 -40⚠️ +160⚠️ +160--00
WiFi/examples/WiFiClientBasic00💚 -40⚠️ +160⚠️ +160--00
WiFi/examples/WiFiClientConnect00💚 -40⚠️ +180⚠️ +200--00
WiFi/examples/WiFiClientEnterprise0000⚠️ +160⚠️ +160--00
WiFi/examples/WiFiClientEvents00💚 -40⚠️ +200⚠️ +200--00
WiFi/examples/WiFiClientStaticIP00💚 -40⚠️ +160⚠️ +160--00
WiFi/examples/WiFiExtender00💚 -40⚠️ +200⚠️ +220--00
WiFi/examples/WiFiIPv60000⚠️ +160⚠️ +160--00
WiFi/examples/WiFiMulti00💚 -40⚠️ +160⚠️ +180--00
WiFi/examples/WiFiMultiAdvanced0000⚠️ +160⚠️ +160--00
WiFi/examples/WiFiScan00💚 -40⚠️ +200⚠️ +200--00
WiFi/examples/WiFiScanAsync💚 -160💚 -40⚠️ +200⚠️ +200--00
WiFi/examples/WiFiScanDualAntenna00💚 -40⚠️ +200⚠️ +200--00
WiFi/examples/WiFiScanTime00💚 -40⚠️ +200⚠️ +220--00
WiFi/examples/WiFiSmartConfig00💚 -40⚠️ +200⚠️ +180--00
WiFi/examples/WiFiTelnetToSerial00💚 -160⚠️ +160⚠️ +160--00
WiFi/examples/WiFiUDPClient00💚 -40⚠️ +160⚠️ +160--00
WiFiProv/examples/WiFiProv00💚 -40⚠️ +180⚠️ +200--💚 -160
Wire/examples/WireMaster⚠️ +40⚠️ +40⚠️ +200⚠️ +200⚠️ +200⚠️ +40
Wire/examples/WireScan⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
Wire/examples/WireSlave⚠️ +40⚠️ +40⚠️ +180⚠️ +200⚠️ +200⚠️ +40
OpenThread/examples/COAP/coap_lamp------⚠️ +200⚠️ +180--
OpenThread/examples/COAP/coap_switch------⚠️ +200⚠️ +200--
OpenThread/examples/SimpleCLI------⚠️ +200⚠️ +200--
OpenThread/examples/SimpleNode------⚠️ +220⚠️ +200--
OpenThread/examples/SimpleThreadNetwork/ExtendedRouterNode------⚠️ +220⚠️ +180--
OpenThread/examples/SimpleThreadNetwork/LeaderNode------⚠️ +200⚠️ +200--
OpenThread/examples/SimpleThreadNetwork/RouterNode------⚠️ +180⚠️ +200--
OpenThread/examples/ThreadScan------⚠️ +200⚠️ +200--
OpenThread/examples/onReceive------⚠️ +200⚠️ +200--
Zigbee/examples/Zigbee_Color_Dimmable_Light------⚠️ +200⚠️ +200--
Zigbee/examples/Zigbee_Color_Dimmer_Switch------⚠️ +200⚠️ +200--
Zigbee/examples/Zigbee_On_Off_Light------⚠️ +200⚠️ +200--
Zigbee/examples/Zigbee_On_Off_Switch------⚠️ +180⚠️ +200--
Zigbee/examples/Zigbee_Scan_Networks------⚠️ +200⚠️ +200--
Zigbee/examples/Zigbee_Temperature_Sensor------⚠️ +200⚠️ +200--
Zigbee/examples/Zigbee_Thermostat------⚠️ +200⚠️ +200--
BluetoothSerial/examples/DiscoverConnect----------00
BluetoothSerial/examples/GetLocalMAC----------00
BluetoothSerial/examples/SerialToSerialBT----------💚 -240
BluetoothSerial/examples/SerialToSerialBTM----------00
BluetoothSerial/examples/SerialToSerialBT_Legacy----------⚠️ +40
BluetoothSerial/examples/SerialToSerialBT_SSP----------00
BluetoothSerial/examples/bt_classic_device_discovery----------💚 -40
BluetoothSerial/examples/bt_remove_paired_devices----------00
ESP32/examples/DeepSleep/SmoothBlink_ULP_Code----------⚠️ +40
ESP32/examples/Touch/TouchButton----------⚠️ +40
Ethernet/examples/ETH_LAN8720----------00
Ethernet/examples/ETH_TLK110----------00

SuGlider added a commit that referenced this pull request Oct 7, 2024
@SuGlider SuGlider changed the title feat(uart): eliminates nonexistent functions feat(uart): fixes serialEventRun() to avois calling available() if serialEvent() is not declared Oct 7, 2024
@SuGlider SuGlider changed the title feat(uart): fixes serialEventRun() to avois calling available() if serialEvent() is not declared feat(uart) 3.z.x Core: fixes serialEventRun() to avois calling available() if serialEvent() is not declared Oct 7, 2024
@TD-er
Copy link
Contributor

TD-er commented Oct 7, 2024

Still why does it need to be called every loop() call?
Isn't every like msec or 100 usec enough? (at 115200 you can only get a new character every 100 usec)
And shouldn't the available() check only be run when begin() was called?

The best location for both checks is probably in the available() function of each serial device.

@VojtechBartoska VojtechBartoska changed the title feat(uart) 3.z.x Core: fixes serialEventRun() to avois calling available() if serialEvent() is not declared feat(uart) 3.1.x Core: fixes serialEventRun() to avois calling available() if serialEvent() is not declared Oct 7, 2024
@VojtechBartoska VojtechBartoska added the Status: Review needed Issue or PR is awaiting review label Oct 7, 2024
@me-no-dev
Copy link
Member

Still why does it need to be called every loop() call?

because there are higher speeds used by some and they do expect to get the event as soon as possible, else they come here and submit issue reports :)

@lucasssvaz lucasssvaz changed the title feat(uart) 3.1.x Core: fixes serialEventRun() to avois calling available() if serialEvent() is not declared feat(uart) 3.1.x Core: fixes serialEventRun() to avoid calling available() if serialEvent() is not declared Oct 7, 2024
@SuGlider SuGlider added the Status: Pending Merge Pull Request is ready to be merged label Oct 7, 2024
@me-no-dev me-no-dev merged commit 0d5d50e into master Oct 7, 2024
63 of 71 checks passed
@me-no-dev me-no-dev deleted the cleans_linker_weak_functions branch October 7, 2024 12:56
me-no-dev pushed a commit that referenced this pull request Oct 7, 2024
…le() if serialEvent() is not declared (#10429)

* fix(uart): applies #10428 to 2.0.x core

* fix(uart): there is no usb serial event in 2.0.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Peripheral: UART Status: Pending Merge Pull Request is ready to be merged Status: Review needed Issue or PR is awaiting review
Projects
Development

Successfully merging this pull request may close these issues.

In ESP32 core version V3.0.5 speed is 30-50% slower than V2.0.17 with Arduino Nano ESP32.
6 participants