rp/gpio: implement Input
This commit is contained in:
16
embassy-rp-examples/src/example_common.rs
Normal file
16
embassy-rp-examples/src/example_common.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
||||
use defmt_rtt as _;
|
||||
use panic_probe as _;
|
||||
|
||||
#[link_section = ".boot2"]
|
||||
#[used]
|
||||
pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER;
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user