mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Convert ReadInterrupt* to return int64_t time (#1417)
HAL_ReadInterruptRisingTimestamp and HAL_ReadInterruptFallingTimestamp return time as a double. Instead, keep the raw integer count and move the double conversion into the C++ and Java code. This enables comparison of the time with other timers.
This commit is contained in:
committed by
Peter Johnson
parent
ef3a31aa20
commit
9207d788ab
@@ -236,9 +236,9 @@ Java_edu_wpi_first_hal_InterruptJNI_disableInterrupts
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_InterruptJNI
|
||||
* Method: readInterruptRisingTimestamp
|
||||
* Signature: (I)D
|
||||
* Signature: (I)J
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_first_hal_InterruptJNI_readInterruptRisingTimestamp
|
||||
(JNIEnv* env, jclass, jint interruptHandle)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ Java_edu_wpi_first_hal_InterruptJNI_readInterruptRisingTimestamp
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
|
||||
int32_t status = 0;
|
||||
jdouble timeStamp = HAL_ReadInterruptRisingTimestamp(
|
||||
jlong timeStamp = HAL_ReadInterruptRisingTimestamp(
|
||||
(HAL_InterruptHandle)interruptHandle, &status);
|
||||
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
@@ -259,9 +259,9 @@ Java_edu_wpi_first_hal_InterruptJNI_readInterruptRisingTimestamp
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_InterruptJNI
|
||||
* Method: readInterruptFallingTimestamp
|
||||
* Signature: (I)D
|
||||
* Signature: (I)J
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_first_hal_InterruptJNI_readInterruptFallingTimestamp
|
||||
(JNIEnv* env, jclass, jint interruptHandle)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ Java_edu_wpi_first_hal_InterruptJNI_readInterruptFallingTimestamp
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
|
||||
int32_t status = 0;
|
||||
jdouble timeStamp = HAL_ReadInterruptFallingTimestamp(
|
||||
jlong timeStamp = HAL_ReadInterruptFallingTimestamp(
|
||||
(HAL_InterruptHandle)interruptHandle, &status);
|
||||
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
|
||||
Reference in New Issue
Block a user