-
Notifications
You must be signed in to change notification settings - Fork 208
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
Simplify dma usage #1238
Simplify dma usage #1238
Conversation
2201f62
to
6844492
Compare
Sorry for these comments trickling in one by one :D, but should Maybe longer term we could think about relaxing this |
Yeah, currently it can't but t.b.h. I wasn't sure if While requiring |
I'm glad we're on the same page, I'll make an issue to track/discuss that elsewhere. This PR LGTM now, just waiting on the next release. For my QSPI display use case, I can pump out an entire |
I opened #1245 with my thoughts. |
I think because this affects the public API I guess we need a change log entry - after that, this looks good to go! |
Oh yes - I just was a bit lazy since this shouldn't get into 0.16.0 or a patch release for that 😄 will add it before marking this as ready |
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.
Once CHANGELOG.md
gets updated I think this LGTM. Once we've published our patch release tomorrow and @MabezDev has given his final stamp of approval, we can merge this I think.
Thanks for this contribution, this looks much nicer now!
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!
I think we're ready to move forward with this! If you don't mind making the last couple changes here, that'd be appreciated! |
1aa700a
to
79a09b7
Compare
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, thanks!
We used to move the driver and the buffers into the DMA transfer and have a way to get them back. That's to prevent the user from initiating another transfer or tamper with the buffers while the transfer is in progress.
However, this makes code using the API look quite clumsy and cumbersome.
We can avoid that by taking buffers and self as
&mut
(with appropriate life-times)e.g.
before
now
Basically, the same thing we did to the passing of GPIOs into drivers (where we previously moved the GPIOs into the driver and had a
free
function to get them back - now we can pass&mut
pins and "get them back" once the driver is dropped)