-
Notifications
You must be signed in to change notification settings - Fork 212
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
Stream x improve #666
Stream x improve #666
Conversation
rebase, please and update examples if it is needed |
can't rebase, there is conflicting change |
first squash commits and then rebase |
will do, but ii need to fix examples first. |
@burrbull do you know a way to check all examples ? when i use |
if you on linux you could run |
merging correctly will be difficult, there was many change since i started this PR, i fear Git will automatically resolve conflict in incoherent way. I have a example not working but I may forgot to check it earlier |
a4b8b13
to
af0cc5e
Compare
@burrbull ready for a review, i just didn't change the CHANGELOG, do know what description i should put. I'm very skeptical Transfer. The main problem is the ownership taking of the peripheral, this prevent to freely use the peripheral. But beyond that, it's seems some people already added some functionality to it just to make it usable for some peripheral, which is again the intend of being general purpose stuff. |
af0cc5e
to
1e9826a
Compare
Sorry, I just found a typo i repeated many time because of automatic completion |
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 can't really comment on the soundness of the DMA stuff but the approach looks good to me. 👍🏻
Since i Just started to use bitflag, i wonder if i should use it for all structure containing a set of boolean to keep coherence |
crap, i missed the annoying "from_bits_retain" method in bitflags. This make my code unsound :( |
@burrbull is it ok ? i think there may a lack of coherency with flags, but i found bitflag! a bit deceiving. The "from_bit_retain" method have disastrous consequence, and using the "Flag::A|Flag::B|Flag::C" is actually very verbose with concrete case: |
ok lets leave bitflags for another PR. |
@burrbull i already commited thing using bitflags |
i may exaggerated a bit with "disastrous consequence" since i fixed the unsoundness. But i still think "from_bits_retain" is bad because of consequence it can have. |
@YruamaLairba could you look at/test #673 ? |
@burrbull what is missing to merge this PR ? do wait for having a good system to manipulate a set of flags ? |
I'm fine to leave bit flags for some future PR. But I don't see sense in duplicates (like |
So finally, i should just ignore what you did in the Flags branch and use structure with boolean field to manipulate several interrupts or flags at once ? |
Yes |
done; i also changed clear_all_flags(&mut self) by clear_flags(&mut self, flags:DmaFlags) and added some all() method to structure |
Ok. I'll merge this after fix release #674 |
Add to |
5ea1589
to
c585905
Compare
Is it ok or a squash is required ? |
better to squash |
add stream methods to set pincos, circ and pfctrl make Stream use dmaDirection instead generic direction make streams use a new DmaChannel enum instead generic stuff conditionnel compilation for DmaChannel enum Redesign ISR API of Stream, this break transfer redesign Stream trait API, break even more stuff implement Stream trait, many thing still broken fix most compile error in Transfer struct handle DmaDataSize relatd stuff stream_disable utility function use utility function for gracefully disable the transfer add/fix interrupt flag manipulation throught transfer type fix Bits impl for PeeripeheralIncrmentOffset fix bit impl of DmaFlowcontreoller fix missing unsafe section fix i2c dma to handle transfer API change. use Dmaflag for more expressive API dma common interrupts setter & getter fix spi-dma example fix rtic-spi-slave-dma.rs example fix bad link in the doc add number_of_transfer method on Transfer fix an example dma API, rename clear_smth_flag to clear_smth dma stream rename smth_flag -> is_smth dma stream rename set_smth_interrupt to listen/unlisten_smth, temporaly break transfer dma stream: listen/unlisten using mask, fix previous break fix, using bitflags for masking require to "truncate" some optimisation oops forgot to remove a TODO mark remove bitflags and mask stuff, use struct with bool field instead update CHANGELOG.md
c585905
to
97f768e
Compare
squashed |
Hi, i'm trying to rewrite the stream struct API, here is the list modification i'm doing on stream:
This is what i'm doing on Transfer struct
-adapt to make it compile with the modified stream API
-put the "disable" logic i removed from Stream
-EDIT add or fix method for interrupt flags manipulations, this is required to make i2c/dma module to compile again
EDIT: i2c/dma module use transfer and stream, so fixing it to fit the change