Skip to content

Commit

Permalink
Update defmt
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernQ committed Dec 9, 2024
1 parent 3fe716b commit 3661c21
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
4 changes: 2 additions & 2 deletions esp-backtrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ default-target = "riscv32imc-unknown-none-elf"
features = ["esp32c3", "panic-handler", "exception-handler", "println", "esp-println/uart"]

[dependencies]
defmt = { version = "0.3.8", optional = true }
defmt = { version = "0.3.10", optional = true }
esp-println = { version = "0.12.0", optional = true, default-features = false, path = "../esp-println" }
semihosting = { version = "0.1.15", optional = true }
semihosting = { version = "0.1.17", optional = true }
embedded-io = { version = "0.6.1", optional = true }

[build-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions esp-backtrace/src/coredump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ impl embedded_io::ErrorType for DumpWriter {

impl embedded_io::Write for DumpWriter {
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
for b in buf.iter() {
for _b in buf.iter() {
#[cfg(feature = "println")]
esp_println::print!("{:02x}", b);
esp_println::print!("{:02x}", _b);
}
Ok(buf.len())
}
Expand Down
11 changes: 0 additions & 11 deletions esp-backtrace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,7 @@ fn panic_handler(info: &core::panic::PanicInfo) -> ! {

println!("");
println!("====================== PANIC ======================");

#[cfg(not(feature = "defmt"))]
println!("{}", info);

#[cfg(feature = "defmt")]
println!("{}", defmt::Display2Format(info));

println!("");
println!("Backtrace:");
println!("");
Expand Down Expand Up @@ -135,13 +129,8 @@ fn panic_handler(info: &core::panic::PanicInfo) -> ! {

println!("");
println!("====================== PANIC ======================");

#[cfg(not(feature = "defmt"))]
println!("{}", info);

#[cfg(feature = "defmt")]
println!("{}", defmt::Display2Format(info));

#[cfg(feature = "colors")]
set_color_code(RESET);

Expand Down

0 comments on commit 3661c21

Please sign in to comment.