Uh oh!
There was an error while loading. Please reload this page.
Spin out driver subclass - #4
Conversation
…o include edge cases and sad paths.
…waiting. Method call to pin_wait_for now blocks instead. Test coverage up to 100%
| module PiPiper | ||
| self.driver= PiPiper::Sysfs | ||
| self.driver= PiPiper::Sysfs::Driver.new |
There was a problem hiding this comment.
Unless you changed PiPiper's code #driver= need a subclass of Driver, not an instance.
There was a problem hiding this comment.
Yes you are correct, forgot to remove the .new. I will fix this.
elmatou
commented
Apr 4, 2016
Hi @zsyed91, |
zsyed91
commented
Apr 4, 2016
@elmatou see my note in the code regarding |
elmatou
commented
Apr 11, 2016
Hi @zsyed91, |
zsyed91
commented
Apr 11, 2016
@elmatou Yeah I have been insanely busy this past week with some life stuff. I will push the suggestions soon. Glad you tested I2C with the code and that it works 😄 |
elmatou
commented
Apr 21, 2016
My bad, select was and should listen to value_file of course, edge_file is only for setup. As far I understand, FileWatcher use modification time, I get through the code and only found this line referring to the file : as for select(2) not blocking on read. We need to investigate more, the SO thread you mentioned was listening on the reading part of the file descriptor and not the error part hence the difference in behaviour. |
zsyed91
commented
Apr 22, 2016
Sure I can take a look again. I will have to look at the difference between checking errors vs just reading via select. If it helps, I can pull that logic out of this PR and open a separate one containing those changes. |
elmatou
commented
Apr 22, 2016
I think it would be best to keep atomic/feature oriented PR. I will
|
elmatou
commented
May 3, 2016
Hi @zsyed91, |
zsyed91
commented
May 3, 2016
@elmatou Hey, sorry I just switched jobs and am currently moving cross-country so this slipped through the cracks. I just pushed the changes. I fixed the driver class and removed the |
…ch. Removed commented out driver line and added a placeholder in the spec_helper until 3.0 PiPiper is released
elmatou
commented
May 4, 2016
Ok, thx you, I'm gonna do a full review of the PR, and it will be good to merge |
zsyed91
commented
May 4, 2016
Awesome, let me know and then I will merge if everything is good to go 😄 |
| module PiPiper | ||
| def self.driver=(driver) | ||
| # Placeholder for testing, PiPiper 3.0 contains this so we can remove | ||
| end |
There was a problem hiding this comment.
you are right, we should remove this.
There was a problem hiding this comment.
right, once we release 3.0 officially I can open a new pr to remove this.
elmatou
commented
May 6, 2016
I just pointed to 2 methods not useful for now. |
DriversubclassFileWatcherinstead ofIO.selectto prevent 100% cpu usage when waiting for value to change. Method now blocks until value is updated.