use defmt::assert; add defmt::panic_handler
This commit is contained in:
+9
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user