The following code panics when setting up a software PWM pin:
fn main() {
env::set_var("RUST_BACKTRACE", "FULL");
let mut g = Gpio::new().unwrap();
let mut pin = g.get(25).unwrap().into_output_low();
pin.set_pwm_frequency(100., 0.2).unwrap();
}
Error as follows:
E:\projects\etc\pibot>ssh pi@192.168.1.99 -i .\keys\id_rsa -t "sudo chmod u+rwx pibot;sudo ./pibot"
thread '<unnamed>' panicked at 'attempt to subtract with overflow', C:\Users\xxxx\.cargo\registry\src\github.com-1ecc6299db9ec823\rppal-0.14.0\src\gpio\soft_pwm.rs:97:24
stack backtrace:
0: rust_begin_unwind
at /rustc/a28f3c88e50a77bc2a91889241248c4543854e61/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/a28f3c88e50a77bc2a91889241248c4543854e61/library/core/src/panicking.rs:65:14
2: core::panicking::panic
at /rustc/a28f3c88e50a77bc2a91889241248c4543854e61/library/core/src/panicking.rs:114:5
3: rppal::gpio::soft_pwm::SoftPwm::new::{{closure}}
at C:\Users\xxxx\.cargo\registry\src\github.com-1ecc6299db9ec823\rppal-0.14.0\src\gpio\soft_pwm.rs:97:24
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Connection to 192.168.1.99 closed.
I tried downgrading to 0.13.0 and it worked again.
Software PWM seems to no longer work in 0.14.0.
The following code panics when setting up a software PWM pin:
Error as follows:
I tried downgrading to 0.13.0 and it worked again.