-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Hello SuGlider, 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 ...
|
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
Outdated
Show resolved
Hide resolved
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
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.