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

Add 0x prefix onto defmt'd pointers. #734

Merged
merged 4 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]

- [#733]: `defmt`: Add formatting for `core::net` with the `ip_in_core` feature
- [#603]: `defmt`: Raw pointers now print as `0x1234` instead of `1234`
- [#536]: `defmt-parser`: Switch to using an enum for errors, and add some help text pointing you to the defmt docs if you use the wrong type specifier in a format string.

[#733]: https://github.com/knurling-rs/defmt/pull/733
[#603]: https://github.com/knurling-rs/defmt/pull/734
[#536]: https://github.com/knurling-rs/defmt/pull/735

## defmt-decoder v0.3.4, defmt-print v0.3.4
Expand Down
2 changes: 1 addition & 1 deletion defmt/src/impls/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ where
T: ?Sized,
{
fn format(&self, fmt: Formatter) {
crate::write!(fmt, "{:x}", *self as *const () as usize);
crate::write!(fmt, "0x{:x}", *self as *const () as usize);
}
}

Expand Down
6 changes: 3 additions & 3 deletions firmware/qemu/src/bin/log.out
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ INFO b"Hi"
INFO [45054, 49406]
INFO [Data { name: b"Hi", value: true }]
INFO true true
INFO aabbccdd
INFO ddccbbaa
INFO 0xaabbccdd
INFO 0xddccbbaa
INFO 1..2
INFO 1..
INFO ..2
Expand All @@ -146,7 +146,7 @@ INFO 1
INFO 1
INFO 1
INFO 1
INFO ccbbaadd
INFO 0xccbbaadd
INFO log data: 43981
INFO flush! 🚽
INFO log more data! 🎉
Expand Down