-
Notifications
You must be signed in to change notification settings - Fork 187
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
Defmt support #171
Comments
theunkn0wn1
added a commit
to theunkn0wn1/heapless
that referenced
this issue
Aug 26, 2020
- defmt has native support for slices, so utilize that.
theunkn0wn1
added a commit
to theunkn0wn1/heapless
that referenced
this issue
Aug 26, 2020
- to conform with other optional features
Merged
theunkn0wn1
added a commit
to theunkn0wn1/heapless
that referenced
this issue
Aug 28, 2020
Hi, I have commented on the PR itself. |
bors bot
added a commit
that referenced
this issue
Sep 24, 2020
172: defmt impl for Vec r=korken89 a=theunkn0wn1 This PR adds support for encoding `heapless::Vec` for usage with `defmt`. `defmt` can already handle slices, so this impl simply invokes that encoder method. I chose to use the slice implementation is I did not perceive the difference between a Vec and a Slice to be of specific importance in a log file, but rather the contents of the vec / slice to be of interest. It also appeared to me as the path of least resistance. I am marking this as a draft as I have yet to be able to validate this against my local hardware, `probe-run` is giving me some grief that I am reasonably sure is unrelated to this change set. Relates to #171 Co-authored-by: joshua salzedo <thHunkn0WNd@gmail.com> Co-authored-by: Joshua Salzedo <joshuasalzedo@gmail.com>
bors bot
added a commit
that referenced
this issue
Sep 24, 2020
172: defmt impl for Vec r=korken89 a=theunkn0wn1 This PR adds support for encoding `heapless::Vec` for usage with `defmt`. `defmt` can already handle slices, so this impl simply invokes that encoder method. I chose to use the slice implementation is I did not perceive the difference between a Vec and a Slice to be of specific importance in a log file, but rather the contents of the vec / slice to be of interest. It also appeared to me as the path of least resistance. I am marking this as a draft as I have yet to be able to validate this against my local hardware, `probe-run` is giving me some grief that I am reasonably sure is unrelated to this change set. Relates to #171 Co-authored-by: joshua salzedo <thHunkn0WNd@gmail.com> Co-authored-by: Joshua Salzedo <joshuasalzedo@gmail.com>
theunkn0wn1
added a commit
to theunkn0wn1/heapless
that referenced
this issue
Dec 9, 2020
- defmt has native support for slices, so utilize that.
theunkn0wn1
added a commit
to theunkn0wn1/heapless
that referenced
this issue
Dec 9, 2020
- to conform with other optional features
theunkn0wn1
added a commit
to theunkn0wn1/heapless
that referenced
this issue
Dec 9, 2020
Available in 0.7.1 |
I get let mut test_vec: Vec<u8, 128> = Vec::new();
...
info!("the vector: {:[u8]}", test_vec); Am I mistaken with the format specifier? |
Have you enabled the feature flag? |
In my testing i used let mut data: Vec<u32, 16> = Vec::new();
data.push(0x42).expect("Failed to push into vec...");
data.push(0x50).expect("Failed to push into vec...");
data.push(0x10).expect("Failed to push into vec...");
defmt::debug!("Writing data....");
defmt::info!("{=[?]}", data);
defmt::debug!("populating string...");
let string: String<32> = String::from("I like pizza");
defmt::debug!("Emitting string...");
defmt::info!("{:?}", string); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I recently discovered the
defmt
library and attempted to integrate it into one of my embedded projects.Unfortunately it appears that
heapless::Vec
doesn't implement thedefmt::Format
trait yet, which blocksdefmt
integration in my downstream.Feature request: support for
defmt::Format
inheapless::Vec
The text was updated successfully, but these errors were encountered: