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
{{ message }}
Repository navigation
Linux PWM implementation throws during construction/setting frequency in some cases #757
using(varpwm=PwmChannel.Create(0,0,500)){// duty cycle is 0.5 by defaultpwm.Frequency=10000;// throws}
from now constructing pwm channel with frequency 10k Hz is not possible without manually editing duty cycle (sysfs).
This is happening because duty cycle still has the old value in the driver (measured in nanosecond) and updating frequency causes that duty cycle gets out of range
I noticed this when we were updating to the new PwmChannel. I believe it is because there is not enough time delayed when opening the port (via file) before interacting with the DC/freq. I mentioned it then, but we couldn't figure out a good approach on timing.
Activity
shaggygi commentedon Oct 1, 2019
I noticed this when we were updating to the new PwmChannel. I believe it is because there is not enough time delayed when opening the port (via file) before interacting with the DC/freq. I mentioned it then, but we couldn't figure out a good approach on timing.
I could duplicate using the PwmPinOutput command in the DeviceTesterApi.
After the exception occurs, you can still see the channel opened by reading the file. And writing the DC/freq works by then, as well.
krwq commentedon Oct 2, 2019
@shaggygi, I've added a fix in #758 - I got 100% repro before and now doesn't repro with the fix.
In some scenarios this is not particularly obvious:
The issue is with duty cycle being out of range (also IO exception suggests that:
Invalid argument)joperezr commentedon Oct 10, 2019
Would we want to service 1.0 with this?
krwq commentedon Oct 10, 2019
I don't have strong opinion either way. On one hand this is relatively rare but on the other it's super annoying when it affects you