Quick rundown of what I did: ```rust fn configure_pin_for_sense(pin: &mut Pin>, sense: SENSE_A) { // SAFETY: Pin is mutably borrowed (so cannot be modified from anywhere else), and // pin is guaranteed to have a valid pin number (because it can only be gotten from the // Peripherals struct) trace!("activating sense for pin {}", pin.pin()); unsafe { &(*pac::P0::ptr()).pin_cnf[pin.pin() as usize] } .modify(|_, w| w.sense().variant(sense)); } ``` That's the function that makes the pin sense things. It's called in the rtic init: ```rust let mut button_in = gpio.p0_16.into_pullup_input().degrade(); configure_pin_for_sense(&mut button_in, SENSE_A::LOW); // activate sense when pin goes to low ``` Then the shutdown is initiated in a task that polls the button at 50Hz (yes an interrupt would be nicer, but oh well) This function waits for a second after bootup before "arming" the interrupt, and then starts the polling. Once the button is pressed, it waits for it to be un-pressed, and shuts down using this code: ```rust info!("system off start"); cx.shared.device_state.lock(|st| *st = DeviceState::Off); while button_in.is_low().unwrap() { embassy_futures::yield_now().await; } Systick::delay(100.millis() /* 50Hz */).await; debug!("Entering System Off Mode"); RawError::convert(unsafe { nrf_softdevice::raw::sd_power_system_off() }) .expect("Couldn't enter System Off Mode"); loop { /* wait until system off */ } ```