mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +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
@@ -215,7 +215,7 @@ public abstract class InterruptableSensorBase extends SendableBase {
|
||||
if (m_interrupt == 0) {
|
||||
throw new IllegalStateException("The interrupt is not allocated.");
|
||||
}
|
||||
return InterruptJNI.readInterruptRisingTimestamp(m_interrupt);
|
||||
return InterruptJNI.readInterruptRisingTimestamp(m_interrupt) * 1e-6;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -229,7 +229,7 @@ public abstract class InterruptableSensorBase extends SendableBase {
|
||||
if (m_interrupt == 0) {
|
||||
throw new IllegalStateException("The interrupt is not allocated.");
|
||||
}
|
||||
return InterruptJNI.readInterruptFallingTimestamp(m_interrupt);
|
||||
return InterruptJNI.readInterruptFallingTimestamp(m_interrupt) * 1e-6;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user