adafruit/adafruit-beaglebone-io-python — pull request #61 by jpbarraca (2014-03-30 00:21:12+00:00)
Title: Added support for timeouts in wait_for_edge

This change makes it able to wait for an edge change but bail out if no change is detected after a timeout.
The code should be mostly backward compatible but enables programs to recover when the hardware goes weird.

The function wait_for_edge will now admit a timeout value and will return 0 or -1 . If the return is 0, an edge change is detected. If the return is -1 a timeout occurred.