FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

IO: Rename the (publicly listed) waitForInterrupt function to waitFor · lAndbz/processing@e4d30fe · GitHub

Repository navigation

Commit e4d30fe

Browse files
committed
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.)
1 parent 2b3dac0 commit e4d30fe

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎java/libraries/io/src/processing/io/GPIO.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,12 +451,17 @@ public static void releasePin(int pin) {
451451
* @return true if the interrupt occured, false if the timeout occured
452452
* @webref
453453
*/
454-
public static boolean waitForInterrupt(int pin, int mode, int timeout) {
454+
public static boolean waitFor(int pin, int mode, int timeout) {
455455
enableInterrupt(pin, mode);
456456
return waitForInterrupt(pin, timeout);
457457
}
458458

459459

460+
public static boolean waitForInterrupt(int pin, int mode, int timeout) {
461+
throw new RuntimeException("The waitForInterrupt function has been renamed to waitFor. Please update your sketch accordingly.");
462+
}
463+
464+
460465
/**
461466
* Waits for the value of an input pin to change
462467
*

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL