-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Conversation
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.
👋 Hello SuGlider, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 56 files 56 suites 4m 12s ⏱️ Results for commit 07b2e1d. ♻️ This comment has been updated with latest results. |
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]
|
Still why does it need to be called every loop() call? The best location for both checks is probably in the |
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 :) |
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
Related links
Closes #10397