mirror of
https://github.com/processing/processing4.git
synced 2026-01-27 18:31:07 +01:00
IO: Rename the (publicly listed) waitForInterrupt function to waitFor
This function is used like this: GPIO.waitFor(pin number, rising/falling/change, timeout or -1) While it's using an interrupt internally, in the way it is used it doesn't relate to the interrupt functions (attachInterrupt, etc) at all. To prevent confusion, rename it to waitFor. (Another possible name would be waitForPin.)
This commit is contained in:
@@ -451,12 +451,17 @@ public class GPIO {
|
||||
* @return true if the interrupt occured, false if the timeout occured
|
||||
* @webref
|
||||
*/
|
||||
public static boolean waitForInterrupt(int pin, int mode, int timeout) {
|
||||
public static boolean waitFor(int pin, int mode, int timeout) {
|
||||
enableInterrupt(pin, mode);
|
||||
return waitForInterrupt(pin, timeout);
|
||||
}
|
||||
|
||||
|
||||
public static boolean waitForInterrupt(int pin, int mode, int timeout) {
|
||||
throw new RuntimeException("The waitForInterrupt function has been renamed to waitFor. Please update your sketch accordingly.");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Waits for the value of an input pin to change
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user