- Notifications
You must be signed in to change notification settings - Fork7.7k
feat(uart): simplifies UART example based on MODBUS standard#11309
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
github-actionsbot commentedApr 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
👋Hello SuGlider, we appreciate your contribution to this project! 📘 Please review the project'sContributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you haveread and signed theContributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR simplifies the UART onReceive example by updating documentation and modifying how received data is handled in order to align with the MODBUS standard.
- Updated callback comments and behavior to reflect onlyOnTimeout usage
- Removed semaphore protection in favor of a simplified while loop for reading available data
- Adjusted setup configurations and reduced the main loop delay to better demonstrate rapid processing
Comments suppressed due to low confidence (1)
libraries/ESP32/examples/Serial/onReceiveExample/onReceiveExample.ino:112
- [nitpick] The main loop delay has been reduced from 1000 ms to 1 ms, which may lead to excessive CPU usage and frequent serial prints. Verify that this rapid polling is intentional for the example's demonstration of RX Timeout behavior.
delay(1);
libraries/ESP32/examples/Serial/onReceiveExample/onReceiveExample.ino OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
libraries/ESP32/examples/Serial/onReceiveExample/onReceiveExample.ino OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
libraries/ESP32/examples/Serial/onReceiveExample/onReceiveExample.ino OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
d63b876
intomasterUh oh!
There was an error while loading.Please reload this page.
Description of Change
Improves and simplifies the Serial OnReceive example.
The example uses Rx Timeout based on MODBUS standard.
This change will demonstrate how to receive any number of bytes and then execute a callback as soon as defined timeout happens.
Tests scenarios
Using this example with ESP32, ESP32-S2, ESP32-S3, ESP32-C3 and ESP32-C6.
Related links
None.