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
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })', src/libcore/result.rs:999:5
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:47
3: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:36
4: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:200
5: std::panicking::default_hook
at src/libstd/panicking.rs:214
6: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:477
7: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:384
8: rust_begin_unwind
at src/libstd/panicking.rs:311
9: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
10: core::result::unwrap_failed
at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/libcore/macros.rs:18
11: core::result::Result<T,E>::unwrap
at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/libcore/result.rs:800
12: cucaracha::pwmled::PwmLed::new
at src/pwmled.rs:40
13: cucaracha::main
at src/main.rs:22
14: std::rt::lang_start::{{closure}}
at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/libstd/rt.rs:64
15: std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:49
16: std::panicking::try::do_call
at src/libstd/panicking.rs:296
17: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:82
18: std::panicking::try
at src/libstd/panicking.rs:275
19: std::panic::catch_unwind
at src/libstd/panic.rs:394
20: std::rt::lang_start_internal
at src/libstd/rt.rs:48
21: std::rt::lang_start
at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/libstd/rt.rs:64
22: main
23: __libc_start_main
because the crate is trying to get /sys/class/pwm/pwmchip{}/pwm{}/{} where on my beaglebone it's /sys/class/pwm/pwmchip4/pwm-4\:0/
The line in my code causing this is pwm.enable(true).unwrap();
The text was updated successfully, but these errors were encountered:
fnpwm_file_wo(chip:&PwmChip,pin:u32,name:&str) -> Result<File>{let f = OpenOptions::new().write(true).open(format!("/sys/class/pwm/pwmchip{}/pwm{}/{}",
chip.number, pin, name
));if !f.is_ok(){let f = OpenOptions::new().write(true).open(format!("/sys/class/pwm/pwmchip{}/pwm-{}:{}/{}",
chip.number, chip.number, pin, name
))?;returnOk(f);}Ok(f.unwrap())}
is working.
Also
format!("/sys/class/pwm/pwm-{}:{}/{}", chip.number, pin, name
)
Not sure how to actually detect if you will get one pwm{} or pwm-{}:{}.
because the crate is trying to get
/sys/class/pwm/pwmchip{}/pwm{}/{}
where on my beaglebone it's/sys/class/pwm/pwmchip4/pwm-4\:0/
The line in my code causing this is
pwm.enable(true).unwrap();
The text was updated successfully, but these errors were encountered: