mirror of
https://github.com/processing/processing4.git
synced 2026-01-27 10:21:26 +01:00
IO: Introduce a variant of waitFor that doesn't take a timeout
This simplifies the semantic of the variant with three arguments, since we now don't have the "-1 means wait forever" case any longer.
This commit is contained in:
@@ -447,7 +447,18 @@ public class GPIO {
|
||||
* Waits for the value of an input pin to change
|
||||
* @param pin GPIO pin
|
||||
* @param mode what to wait for: GPIO.CHANGE, GPIO.FALLING or GPIO.RISING
|
||||
* @param timeout don't wait more than timeout milliseconds (-1 waits indefinitely)
|
||||
* @webref
|
||||
*/
|
||||
public static void waitFor(int pin, int mode) {
|
||||
waitForInterrupt(pin, mode, -1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Waits for the value of an input pin to change
|
||||
* @param pin GPIO pin
|
||||
* @param mode what to wait for: GPIO.CHANGE, GPIO.FALLING or GPIO.RISING
|
||||
* @param timeout don't wait more than timeout milliseconds
|
||||
* @return true if the interrupt occured, false if the timeout occured
|
||||
* @webref
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user