Skip to content

Add an option to generate defmt support unconditionally #74

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

honzasp
Copy link

@honzasp honzasp commented Jun 1, 2025

This PR implements three different options for defmt support in generated code:

  • DefmtOption::Disabled: code that implements defmt::Display is not included in the generated code (as already implemented).
  • DefmtOption::Feature(feature): code for defmt::Display is gated behind a feature with given name (as already implemented).
  • DefmtOption::Enabled: code for defmt::Display is included unconditionally (this option is new).

This is a breaking change in the API but backward compatible change in the CLI interface. I also added a CLI option --yes-defmt which corresponds to DefmtOption::Enabled (the opposite of --no-defmt, which maps to DefmtOption::Disabled).

This is useful when you want to include some code generated by chiptool into a larger crate where defmt is always available.

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.

1 participant