Minor bit of cleanup in the ant scripts around the build src and target on javac, enabling use of Java 11 language features within processing itself. Note that the build is sustained on either 1.8 or 11 in terms of lanugage features but the code is no longer compatible with the Java 8 runtime due to backwards-incompatable changes made starting in Java 9.
If the file node is not accessible yet, NativeInterface.writeFile() will return -EACCES instead of -EPERM. Thanks @msurguy for reporting this and testing.
This provided constants that translated from the physical header pin numbers to GPIO lines. Instead, we (and the majority of other Pi related documentation out there) now just use GPIO numbers exclusively.
The class hasn't been used in examples since a few versions, and also wasn't ever properly documented in the reference, so unlikely that many people will notice.
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.)
Some measurements with a logic analyzer and the Raspberry Pi 2
sleep: 0.001500, measured avg: 0.0015357, measured 0.95 perc.: 0.0015573
sleep: 0.0185, measured avg: 0.0186177, measured 0.95 perc.: 0.0186345
servo_pulse_oversleep was set to account for the (expected) overhead of waking up and toggling the pin with help from the numbers above.
Instead of throwing an exception early on, this makes it possible to test all other parts of sketches that make light use of the IO library. A warning is printed once after startup for those environments.
This was tested on OS X against all examples that come with the IO library. Note: x86 and x64 are technically supported platforms. If a user on those prefers to use simulation instead, it is necessary to call NativeInterface.alwaysSimulate() before any other IO library function.