Closed scm6079 closed 10 years ago
Thank you. I'll test it next time I'm near a PiFace Digital. Before I merge it though, I have a few ideas:
pifacedigital_disable_interrupts
function? The idea sprung to mind however I can't really see people disabling and enabling interrupts throughout their program. Does the interrupts logic require cleaning up?Not bad ideas -- I don't have a PiFace C&D -- so I'll let you add them to that module since I have no way to test. I'll add interrupt enable + disable methods to the libmcp23s17 and issue a new pull request for both libs.
Just an FYI, I changed the order of the arguments for the wait function for consistency with the rest of the library. hw_addr
always comes last.
uint8_t pifacedigital_wait_for_input(uint8_t hw_addr, int timeout)
to
uint8_t pifacedigital_wait_for_input(int timeout, uint8_t hw_addr)
Added interrupt support, including GPIO interrupt export to userspace and blocking input read method. Commented example program and included simple example efficient wait for input method.