You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using rust_gpiozero v0.2.1 with an Raspberry Pi 4B and found a situation where the library isn't responding to interrupts.
I'm not a 100% sure that it is a concurrency bug, but I was only able to replicate the problem in a concurrent situation.
The following minimal reproducible example responds only alternating between the pins and doesn't continue on every falling edge.
use std::thread;use std::time::Duration;use rust_gpiozero::input_devices::DigitalInputDevice;fnevent_loop(pin:u8) -> thread::JoinHandle<()>{
thread::spawn(move || {letmut dev = DigitalInputDevice::new(pin);println!("init {} done", pin);letmut counter = 0_usize;loop{println!("await {} off {}", pin, counter);
dev.wait_for_inactive(None);println!("awaited {} off {}", pin, counter);
thread::sleep(Duration::from_millis(100));
counter += 1;}})}fnmain(){let first_el = event_loop(6);event_loop(16).join().unwrap();
first_el.join().unwrap();}
The text was updated successfully, but these errors were encountered:
I am using rust_gpiozero v0.2.1 with an Raspberry Pi 4B and found a situation where the library isn't responding to interrupts.
I'm not a 100% sure that it is a concurrency bug, but I was only able to replicate the problem in a concurrent situation.
The following minimal reproducible example responds only alternating between the pins and doesn't continue on every falling edge.
The text was updated successfully, but these errors were encountered: