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

Flags #673

Merged
merged 2 commits into from
Nov 19, 2023
Merged

Flags #673

merged 2 commits into from
Nov 19, 2023

Conversation

burrbull
Copy link
Contributor

Based on #666

@burrbull burrbull force-pushed the flags branch 3 times, most recently from d162bc6 to f9879e2 Compare July 20, 2023 04:16
@burrbull burrbull mentioned this pull request Jul 20, 2023
src/dma/mod.rs Outdated Show resolved Hide resolved
src/dma/mod.rs Outdated Show resolved Hide resolved
src/dma/mod.rs Outdated Show resolved Hide resolved
src/dma/mod.rs Outdated Show resolved Hide resolved
src/dma/mod.rs Outdated Show resolved Hide resolved
@YruamaLairba
Copy link
Contributor

@burrbull if i summarize, you removed single "listen_smth" in favor of "listen(DmaInterupts)" and now to check a flag you need to do stream.all_flags().is_smth() instead of stream.is_smth()

@YruamaLairba
Copy link
Contributor

note for bitflags, i wonder it it worse to check for better alternative. for example with bitflag 1.3.* you have garantee that unused bit are delete.
I also saw bitbag wich define flags as enum, and a bitbag where you store your flags. It allow to do import flag name in the current scope and write thing like

let flags = A | B | C;

however Bitbag may miss some functionnality compared to bitflags

@burrbull
Copy link
Contributor Author

@burrbull if i summarize, you removed single "listen_smth" in favor of "listen(DmaInterupts)" and now to check a flag you need to do stream.all_flags().is_smth() instead of stream.is_smth()

No. It should still work.

@burrbull
Copy link
Contributor Author

I also saw bitbag wich define flags as enum, and a bitbag where you store your flags. It allow to do import flag name in the current scope and write thing like

Interesting. Have not see it before.

@YruamaLairba
Copy link
Contributor

lol, didn't see you gave a default implementation in the trait definition

@burrbull
Copy link
Contributor Author

I also saw bitbag wich define flags as enum, and a bitbag where you store your flags. It allow to do import flag name in the current scope and write thing like

Interesting. Have not see it before.

Looks like it is not marked as no_std.

@burrbull burrbull force-pushed the flags branch 2 times, most recently from 5e172d0 to a808262 Compare July 26, 2023 05:09
@burrbull
Copy link
Contributor Author

burrbull commented Jul 26, 2023

Looks like I've found good replacement.
https://docs.rs/flagset/0.4.3/flagset/
also similar is https://docs.rs/enumflags2/0.7.7/enumflags2/struct.BitFlags.html

Copy link
Member

@therealprof therealprof left a comment

Choose a reason for hiding this comment

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

Sweet, I like the new interface. Quite breaking, though.

@therealprof therealprof added this pull request to the merge queue Nov 19, 2023
Merged via the queue into master with commit 4c16f3d Nov 19, 2023
24 checks passed
@burrbull burrbull deleted the flags branch November 19, 2023 20:03
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.

3 participants