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

derive(defmt::Format) for embedded systems #77

Open
elpiel opened this issue Jan 27, 2024 · 2 comments
Open

derive(defmt::Format) for embedded systems #77

elpiel opened this issue Jan 27, 2024 · 2 comments

Comments

@elpiel
Copy link

elpiel commented Jan 27, 2024

It would be nice to introduce defmt as dependency (it will bump MSRV to 1.65 I believe) and add the derives behind a feature.

I see there hasn't been much development in the crate but there are some opened PRs and I think this would a good addition as a feature especially since embedded-hal 1.0 crate was recently released and there are a few driver crates that use mint like the bno055 one.

@Ralith
Copy link
Contributor

Ralith commented Jan 27, 2024

The intention is generally that you store your data in (and display it with) more feature-rich types, and convert to mint only when passing through interfaces. You can also just call as_ref() and display the underlying array.

@elpiel
Copy link
Author

elpiel commented Jan 29, 2024

I understand this, however, there's already a serde feature and when working on embedded systems I tend to directly use the structures provided by the driver crate when logging information.

It would also help if you can keep the structure dating instead of obscuring it as an array.

It's also common in the community to include defmt derives, including in embassy and embedded-hal:
https://docs.rs/crate/embedded-hal/latest/features

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

No branches or pull requests

2 participants