mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-01-10 16:25:37 +00:00
use defmt in panic-log
This commit is contained in:
parent
60dd65fa1f
commit
217207f602
2 changed files with 18 additions and 2 deletions
|
@ -7,4 +7,20 @@ version = "0.0.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cortex-m = "0.6.4"
|
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 = []
|
|
@ -6,7 +6,7 @@ use cortex_m::asm;
|
||||||
|
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
fn panic(info: &PanicInfo) -> ! {
|
fn panic(info: &PanicInfo) -> ! {
|
||||||
log::error!("{}", info);
|
defmt::error!("{}", defmt::Debug2Format(&info));
|
||||||
|
|
||||||
// abort instruction: triggers a HardFault exception which causes probe-run to exit
|
// abort instruction: triggers a HardFault exception which causes probe-run to exit
|
||||||
asm::udf()
|
asm::udf()
|
||||||
|
|
Loading…
Reference in a new issue