-
Notifications
You must be signed in to change notification settings - Fork 344
feat: uart break send + detect #4284
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
base: main
Are you sure you want to change the base?
Conversation
/// Waits for a break condition to be detected. | ||
/// | ||
/// This is a blocking function that will continuously check for a break condition. | ||
#[instability::unstable] | ||
pub fn wait_for_break(&mut self) { | ||
while !self.uart.info().brk_det().bit_is_set() { | ||
// wait | ||
} | ||
} | ||
|
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.
@bugadani - I added wait_for_break
to complete the HIL test but I would intend to use it more as an interrupt handler now that we have Rx event for break detection.
Do you approve of this?
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.
I think doing both should be fine. This function has lower latency than any interrupt handler would, so it can probably stay and remain useful in this form.
It makes sense to add an UartInterrupt::Break
variant.
It would be nice to have a wait_for_break_with_timeout
variant, and an async fn wait_for_break_async
, too.
@bugadani - can you tell why this isn't compiling for me? |
ESP32-C2, C3 and H2 don't have GPIO16 and 17 |
@bugadani - can you help me understand why my HIL test is failling only on |
My guess is that you need to start waiting for a break condition before you stop sending it. |
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packages
command to ensure that all changed code is formatted correctly.CHANGELOG.md
in the proper section.Extra:
Pull Request Details 📖
Description
Continuation of #3177 - aiming for 1.0
Testing
Need help with HIL testing