Switch away from NI interrupt manager to custom implementation (#3705)

* Switch away from NI interrupt manager to custom implementation

* Formatting

* Fix tidy

* Formatting

* Fix loading

* Make interrupt api public

* Add multiple wait api

* Formatting

* Fix build

* Fix review comments

* wpiformat

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Thad House
2022-10-13 17:25:54 -07:00
committed by GitHub
parent ca43fe2798
commit 58b6484dbe
11 changed files with 272 additions and 16 deletions

View File

@@ -50,21 +50,40 @@ Java_edu_wpi_first_hal_InterruptJNI_cleanInterrupts
/*
* Class: edu_wpi_first_hal_InterruptJNI
* Method: waitForInterrupt
* Signature: (IDZ)I
* Signature: (IDZ)J
*/
JNIEXPORT jint JNICALL
JNIEXPORT jlong JNICALL
Java_edu_wpi_first_hal_InterruptJNI_waitForInterrupt
(JNIEnv* env, jclass, jint interruptHandle, jdouble timeout,
jboolean ignorePrevious)
{
int32_t status = 0;
int32_t result = HAL_WaitForInterrupt((HAL_InterruptHandle)interruptHandle,
int64_t result = HAL_WaitForInterrupt((HAL_InterruptHandle)interruptHandle,
timeout, ignorePrevious, &status);
CheckStatus(env, status);
return result;
}
/*
* Class: edu_wpi_first_hal_InterruptJNI
* Method: waitForMultipleInterrupts
* Signature: (IJDZ)J
*/
JNIEXPORT jlong JNICALL
Java_edu_wpi_first_hal_InterruptJNI_waitForMultipleInterrupts
(JNIEnv* env, jclass, jint interruptHandle, jlong mask, jdouble timeout,
jboolean ignorePrevious)
{
int32_t status = 0;
int64_t result =
HAL_WaitForMultipleInterrupts((HAL_InterruptHandle)interruptHandle, mask,
timeout, ignorePrevious, &status);
CheckStatus(env, status);
return result;
}
/*
* Class: edu_wpi_first_hal_InterruptJNI
* Method: readInterruptRisingTimestamp