-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running SysFsDriverTests or RaspberryPiDriverTests causes PWM to be unusable #874
Comments
The reason for your problem is #857. You need to reset the pin to PWM mode after some other test has set it to in or out. |
@pgrawehr possible but I don't believe any of these drivers should be even touching PWM pin... |
actually seems they do touch it... |
Hmm.. I'm kinda leaning toward not allowing to open any pins which have mode set to something which we do not understand to avoid similar problems in the future... @pgrawehr - that should at least prevent the problems like this since they are really weird to debug |
@krwq I wouldn't completely disallow it, but make sure they are not opened in different modes at the same time. Otherwise, you would still not be able to open a pin in PWM mode if another application has set it to Output. |
Yes, other thing I'm considering is perhaps let user decide what to do on dispose, i.e.:
The DoNotClose is related to #347 |
I didn't encounter this scenario, but I think you're right. Not sure whether the XYZ parameter should be given on |
@pgrawehr IMO Open because:
|
That sounds reasonable. Wouldn't prevent to have it on Close(), too (to explicitly do something else). |
@pgrawehr not sure how would that work/give if we don't add other modes that you suggested in the other issues (perhaps we should consider that as an option). We won't be able to restore to previous unless we explicitly store it before |
@krwq True, but if we offer to restore the previous mode, we need to be able to store it anyway. (unless we just throw if the previous mode was unknown and RestoreToPrevious was selected, but that's pretty useless then) Without adding the list of modes, we would only be able to force it into a specific one, but not necessarily restore to something unknown. This doesn't necessarily mean that the extra modes will be visible from outside, but hiding that would make the implementation ugly, I think (and prevent extensions like the pigpio from using it). |
Fixed with #1128. |
After running SysFsDriverTests or RaspberryPiDriverTests PWM no longer works.
I have 100% repro: If I run PWM tests in a loop or run LibGpiodDriverTests everything works without any issues.
If I run SysFS or RPI3 GPIO tests once after that PWM becomes completely unusable and stops reacting to any changes (regardless if using PWM manually through
/sys/class/pwm/
or our APIs) - PI has to be rebooted.Found during testing #758
I'm currently on latest from master and my PI3 is running Raspbian after
sudo apt-get update
andsudo apt-get upgrade
(was reproing before updates as well).I'll try to further isolate the problem if I have time.
The text was updated successfully, but these errors were encountered: