diff options
Diffstat (limited to 'examples/src/example_common.rs')
-rw-r--r-- | examples/src/example_common.rs | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/examples/src/example_common.rs b/examples/src/example_common.rs index f402f7f..4ebb100 100644 --- a/examples/src/example_common.rs +++ b/examples/src/example_common.rs @@ -1,30 +1,5 @@ #![macro_use] -use nrf_softdevice_defmt_rtt as _; // global logger +use defmt_rtt as _; // global logger +use embassy_nrf as _; // time driver use panic_probe as _; - -use embassy_nrf as _; - -use alloc_cortex_m::CortexMHeap; -use core::alloc::Layout; -use core::sync::atomic::{AtomicUsize, Ordering}; -use defmt::panic; - -// this is the allocator the application will use -#[global_allocator] -static ALLOCATOR: CortexMHeap = CortexMHeap::empty(); - -// define what happens in an Out Of Memory (OOM) condition -#[alloc_error_handler] -fn alloc_error(_layout: Layout) -> ! { - panic!("Alloc error"); -} - -defmt::timestamp! {"{=u64}", { - static COUNT: AtomicUsize = AtomicUsize::new(0); - // NOTE(no-CAS) `timestamps` runs with interrupts disabled - let n = COUNT.load(Ordering::Relaxed); - COUNT.store(n + 1, Ordering::Relaxed); - n as u64 - } -} |