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

Lift static requirement on DMA buffers #1837

Merged
merged 6 commits into from
Jul 25, 2024

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Jul 19, 2024

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.
  • My changes are in accordance to the esp-rs API guidelines

Extra:

Pull Request Details 📖

Description

This makes it possible to use non-static buffers for DMA. Closes #1245

Testing

All tests and examples work like before. Try using non-static DMA buffers

esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
esp-hal/src/dma/mod.rs Show resolved Hide resolved
@bjoernQ bjoernQ marked this pull request as ready for review July 19, 2024 12:39
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

A couple more changes, sorry!

Could we also add a top level hal comment (somewhere?) to state that in general our drivers are not core::mem::forget safe, and nothing from the HAL should be core::mem::forget'd to avoid UB?

esp-hal/src/dma/mod.rs Show resolved Hide resolved
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Thanks! This looks great!

@bjoernQ bjoernQ force-pushed the allow-non-static-dma-buffers branch from 87d794f to 935878b Compare July 25, 2024 09:09
Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for taking care of this!

@@ -28,7 +28,6 @@ embassy-sync = { version = "0.6.0", optional = true }
embassy-usb-driver = { version = "0.1.0", optional = true }
embassy-usb-synopsys-otg = { version = "0.1.0", optional = true }
embedded-can = { version = "0.4.1", optional = true }
embedded-dma = "0.2.0"
Copy link
Member

Choose a reason for hiding this comment

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

Glad to see this go, never really understood the point of it honestly 😁

@jessebraham jessebraham added this pull request to the merge queue Jul 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jul 25, 2024
@jessebraham
Copy link
Member

Looks like this needs a rebase, please!

@bjoernQ bjoernQ force-pushed the allow-non-static-dma-buffers branch from 935878b to fe7d5dd Compare July 25, 2024 13:37
@MabezDev MabezDev enabled auto-merge July 25, 2024 13:37
@MabezDev MabezDev added this pull request to the merge queue Jul 25, 2024
Merged via the queue into esp-rs:main with commit c6207c0 Jul 25, 2024
18 checks passed
@MabezDev MabezDev mentioned this pull request Aug 28, 2024
5 tasks
@bjoernQ bjoernQ deleted the allow-non-static-dma-buffers branch November 26, 2024 08:42
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.

Remove 'static bound requirement on DMA buffers?
4 participants