use defmt::assert; add defmt::panic_handler

This commit is contained in:
Jorge Aparicio
2020-11-24 17:38:08 +01:00
parent 647289a660
commit ae0df60ec2
3 changed files with 13 additions and 4 deletions
+9 -1
View File
@@ -3,10 +3,18 @@
use core::sync::atomic::{AtomicUsize, Ordering};
use defmt_rtt as _; // global logger
use panic_probe as _;
// TODO(5) adjust HAL import
// use some_hal as _; // memory layout
use panic_probe as _;
// same panicking *behavior* as `panic-probe` but doesn't print a panic message
// this prevents the panic message being printed *twice* when `defmt::panic` is invoked
#[defmt::panic_handler]
fn panic() -> ! {
cortex_m::asm::udf()
}
#[defmt::timestamp]
fn timestamp() -> u64 {
static COUNT: AtomicUsize = AtomicUsize::new(0);