Something went wrong. Try again.
Firmware for the b-parasite board, but in Rust.
Something went wrong. Try again.
603 B · 26 lines
Rust
at ci-fix
123456789101112131415161718192021222324252627use embassy_nrf::{ Peri, gpiote::{InputChannel, InputChannelPolarity}, peripherals::{GPIOTE_CH0, P0_30},};use embassy_time::Timer;
use crate::state::START_MEASUREMENTS;
#[embassy_executor::task]pub async fn task(channel: Peri<'static, GPIOTE_CH0>, pin: Peri<'static, P0_30>) { let measure = START_MEASUREMENTS.sender();
let mut input = InputChannel::new( channel, pin, embassy_nrf::gpio::Pull::Up, InputChannelPolarity::LoToHi, );
loop { input.wait().await; measure.send(()); Timer::after_secs(5).await; }}