Xous: Interrupts
fn setup_int2() -> xous::Result {
let gpio = xous::syscall::map_physical(
Some(0xe0000000), None, 4096)?;
xous::syscall::claim_interrupt(2, |_int_num, gpio| {
unsafe {
let val = gpio.read_volatile();
gpio.write_volatile(val + 1);
};
}, gpio)
}
All in userspace