From 514bcf68d34d8e765a9fbfaee73fb1aab999f1c9 Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Tue, 6 Dec 2022 16:56:54 +0100 Subject: [PATCH] fix panic handler exercise --- embedded-workshop-book/src/panicking.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/embedded-workshop-book/src/panicking.md b/embedded-workshop-book/src/panicking.md index 72cba13..2d0665e 100644 --- a/embedded-workshop-book/src/panicking.md +++ b/embedded-workshop-book/src/panicking.md @@ -37,12 +37,13 @@ stack backtrace: In `no_std` programs the behavior of panic is defined using the `#[panic_handler]` attribute. In the example, the *panic handler* is defined in the `panic_log` crate but we can also implement it manually: -✅ Comment out the `panic_probe` import and add the following function to the example: +✅ Comment out the `use apps as _;` import and add the following function to the example: ``` rust #[panic_handler] fn panic(info: &core::panic::PanicInfo) -> ! { - defmt::panic!("{}", info); + defmt::error!("{}", defmt::Debug2Format(info)); + asm::udf(); } ```