-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support defmt
#34
Comments
Actually, the derive option should already work, but I haven't tested. |
It does not seem to work for me, and it should not right? If I read the macro correct: macro_rules! bitfield {
($(#[$attribute:meta])* pub struct $($rest:tt)*) => { ... };
($(#[$attribute:meta])* struct $($rest:tt)*) => { ... };
($(#[$attribute:meta])* ($($vis:tt)*) struct $name:ident($($type:tt)*); impl Debug; no default
BitRange; $($rest:tt)*) => { ... };
etc etc etc In that last line the macro matches directly on As a embedded user (where bitfields are rather commen) I would love to get all the fields in the output though. |
its not yet implemented/broken, see: dzamlo/rust-bitfield#34
The correct syntax to auto derive Like so: bitfield! {
+ #[derive(defmt::Format)]
struct CtrlMeasurement(u8);
- impl defmt::Format;
u8;
pub from into Oversampling, temperature_os, set_temperature_os: 7, 5;
pub from into Oversampling, pressure_os, set_pressure_os: 4, 2;
pub from into SensorMode, mode, set_mode: 1, 0;
} |
This depends on the level of support we want:
#[derive(Format)]
but we will not get all the fields in the debug output only.0
bitfield_debug
todefmt
and get all the fields in the output, but this seems like a lot of effort(ping @brandonros)
The text was updated successfully, but these errors were encountered: