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

unstabilize Uart::split, globally remove _bytes postfix #3137

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

MabezDev
Copy link
Member

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 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo xtask fmt-packages command to ensure that all changed code is formatted correctly.
  • My changes were added to the CHANGELOG.md in the proper section.
  • I have added necessary changes to user code to the Migration Guide.
  • My changes are in accordance to the esp-rs API guidelines

Extra:

Pull Request Details 📖

This PR removes the postfix _bytes whereever the input parameter was a byte slice. This leaves us with the common case of write == bytes, and gives us scope to add write_words, write_bits etc in the future.

It also unstabilizes Uart::split the the different halfs respectively.

esp-hal/src/ecc.rs Outdated Show resolved Hide resolved
@MabezDev MabezDev force-pushed the remove-bytes-postfix branch from e273350 to a6fcdd3 Compare February 14, 2025 10:52
esp-hal/src/uart.rs Outdated Show resolved Hide resolved
## UART changes

Uart `write_bytes` is now blocking and return the number of bytes written. `read_bytes` will block until it fills the provided buffer with received bytes, use `read_buffered_bytes` to read the available bytes without blocking.
Uart `write_bytes` is now blocking and return the number of bytes written. `read_bytes` will block until it fills at least one byte into the buffer with received bytes, use `read_buffered_bytes` to read the available bytes without blocking.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were renamed, right?

@@ -120,8 +120,8 @@ impl crate::interrupt::InterruptConfigurable for Sha<'_> {
}

// A few notes on this implementation with regards to 'memcpy',
// - It seems that ptr::write_bytes already acts as volatile, while ptr::copy_*
// does not (in this case)
// - It seems that ptr::write already acts as volatile, while ptr::copy_* does
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably just remove this line completely. ptr::write is not volatile access, regardless of how it acts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants