These changes both simplify the Java code and improve performance across the
JNI boundary.
This also fixes the AnalogCrossConnectTest by adding delays to
setInterruptHigh() and setInterruptLow() to ensure the change in voltage has
time to propagate and extends the timeouts in AbstractInterruptTest.
Detailed changes:
Hoisted status checks to C. This avoids the need to create direct byte
buffers (expensive) and significantly simplifies the Java code. The C code
now directly generates the exception or reports the error to the DS.
The JVM pointer is now a global across the JNI, initialized by the OnLoad
function, avoiding the need for some of the class-specific initializers to
get this pointer for callbacks.
Opaque pointers (such as ports) are now passed as long values rather than
with a ByteBuffer wrapper.
Added extern "C" to source files. This allows earlier detection of JNI
definition mismatches to the Java source headers.
Changed JNI signatures to more closely match HAL signatures (in particular,
boolean is now universally used instead of byte for HAL bool, which cleans
up mapping back and forth to 1/0 from true/false).
Change-Id: I4ea0032cabb0871cd74106a3a70d947258c29d2d
The HAL functions often call NI functions that may expect status to be
initialized on entry. Java does not guarantee direct pointer allocation
memory to be initialized, although that may have been occurring by accident.
Change-Id: I5e3a553f3a7be8de3716ccfc13e6ca1cb4f2a552
Modules aren't used anymore in wpilibc and wpilibj, so the hal functions
that references them and and JNI bindings for these functions have been
pulled out.
Both Counter classes were also modified because they still referenced
modules.
Change-Id: Ic01feb145a4ed5f08cd55f140867c721f5ee7b10
Analog triggers now work in Java.
Integration tests for analog triggers are included.
A message in the C++ analog trigger IT was fixed.
Change-Id: I50007c6901b8391d32c0e81becdbe18e48a7840f
This is the changes made by Patrick Plenefisch converting the native
code to use CMake and the CMake Maven Plugin, as opposed to the
native Maven plugin. This is to allow for compatibility with newer
versions of the GCC toolchain. All the cpp sources were moved from
maven style directories to cpp style directories for CMake.
Change-Id: I67f5e3608948f37c83b0990d232105a3784f8593