use 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; } }