-
Notifications
You must be signed in to change notification settings - Fork 30
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
Implement Debug and defmt::Format for fieldsets, enums and the interrupt enum. #44
Conversation
could you make defmt optional at generation time? Currently the generated code will always contain the |
I was thinking about that and I actually initially did that. However, adding a knob for this is a breaking change, and I wasn't sure how much freedom to allow: should the user be able to choose their own feature name? That, and the fact that other feature flags are not configurable at generation time, I figured it might be fine like this. I also thought, if this tool is basically used for embassy only, getting those warnings might be nice to ensure that the embassy PAC crates don't forget to add the feature to their Cargo.toml. But, I can add a generation time configuration option :) |
8946acc
to
ed69387
Compare
ed69387
to
de3e854
Compare
Added an option for it to I also modified the way that Note that I defaulted to generating |
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.
thanks!
This PR:
Debug
anddefmt::Format
traits for generated fieldsets, value enums and interrupt enums.defmt::Format
impls are disabled by default and must be enabled with a"defmt"
feature.expand_extends
transform which I think was accidentally removed during a refactor of the transform system (couldn't test this with thestm32-metapac
crate otherwise).I think the
Debug
anddefmt::Format
impls can help tremendously when debugging embedded applications :)I've tested this by using it to regenerate the
stm32-metapac
crate, which added the trait impls as expected. I've also tested that the generated code compiles and looks as as expected.