rp/gpio: implement Input

This commit is contained in:
Dario Nieuwenhuis
2021-03-29 21:33:46 +02:00
parent 5f6f1c38d9
commit 403b308279
6 changed files with 124 additions and 75 deletions

View 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
}
}