use defmt in panic-log

This commit is contained in:
Lotte Steenbrink 2021-04-14 12:12:02 +02:00 committed by Mirabellensaft
parent 60dd65fa1f
commit 217207f602
2 changed files with 18 additions and 2 deletions

View file

@ -7,4 +7,20 @@ version = "0.0.0"
[dependencies]
cortex-m = "0.6.4"
log = "0.4.8"
defmt = "0.2.1"
[features]
# defmt logging levels
default = [
"defmt-debug",
# "dependency-a/defmt-trace",
]
# do NOT modify these features
defmt-default = []
defmt-trace = []
defmt-debug = []
defmt-info = []
defmt-warn = []
defmt-error = []

View file

@ -6,7 +6,7 @@ use cortex_m::asm;
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
log::error!("{}", info);
defmt::error!("{}", defmt::Debug2Format(&info));
// abort instruction: triggers a HardFault exception which causes probe-run to exit
asm::udf()