Use enumset for DMA interrupts instead of countless functions#2196
Use enumset for DMA interrupts instead of countless functions#2196bugadani merged 8 commits intoesp-rs:mainfrom
Conversation
I'd rather if you sent everything in at once, if you're ready with the other parts. Just separating into small-ish commits is enough, and it's sometimes better if we have the complete picture up front. |
Noted. In this case, I don't have the other parts ready yet. |
|
Looks like the HIL setup for the base ESP32 is broken. Almost like the usb cable is disconnected. |
It's being looked at.
:) Given the +200 lines of diff... 😅 |
Done |
I can at least confirm the i2s_sound example still works on ESP32 |
…bits_as_enum # Conflicts: # esp-hal/src/dma/pdma.rs
There was a problem hiding this comment.
If you can make the flag enums' discriminants correspond to their actual register bits, there's a chance the compiler can see through the code and read the register into the enumset in one step.
I'll not ask you to start experimenting with this, but I'll try and look into it because there's a bit of efficiency we're leaving on the table.
Otherwise, thank you a lot, this looks awesome :)
|
Looks like #2210 needs to go in first |
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-packagescommand to ensure that all changed code is formatted correctly.CHANGELOG.mdin the proper section.Extra:
Pull Request Details 📖
Description
PR title says it all. Rather than have many
listen_*,unlisten_*, etc methods for every interrupt bit, I've collapsed it down to just one method that takes an enumset.I've also added documentation for the interrupts.
This is part of #1767.
To make it easy to review, I'm doing this in multiple steps.
The first step was to remove the methods from the pdma and gdma files.
Unfortunately I encountered #2193 and I'm choosing to fix it in this PR.
Testing
CI, I don't have any PDMA chips on me at the moment.