mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +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
@@ -77,24 +77,28 @@ void HAL_DisableInterrupts(HAL_InterruptHandle interruptHandle,
|
||||
/**
|
||||
* Returns the timestamp for the rising interrupt that occurred most recently.
|
||||
*
|
||||
* This is in the same time domain as HAL_GetFPGATime().
|
||||
* This is in the same time domain as HAL_GetFPGATime(). It only contains the
|
||||
* bottom 32 bits of the timestamp. If your robot has been running for over 1
|
||||
* hour, you will need to fill in the upper 32 bits yourself.
|
||||
*
|
||||
* @param interruptHandle the interrupt handle
|
||||
* @return timestamp in seconds since FPGA Initialization
|
||||
* @return timestamp in microseconds since FPGA Initialization
|
||||
*/
|
||||
double HAL_ReadInterruptRisingTimestamp(HAL_InterruptHandle interruptHandle,
|
||||
int32_t* status);
|
||||
int64_t HAL_ReadInterruptRisingTimestamp(HAL_InterruptHandle interruptHandle,
|
||||
int32_t* status);
|
||||
|
||||
/**
|
||||
* Returns the timestamp for the falling interrupt that occurred most recently.
|
||||
*
|
||||
* This is in the same time domain as HAL_GetFPGATime().
|
||||
* This is in the same time domain as HAL_GetFPGATime(). It only contains the
|
||||
* bottom 32 bits of the timestamp. If your robot has been running for over 1
|
||||
* hour, you will need to fill in the upper 32 bits yourself.
|
||||
*
|
||||
* @param interruptHandle the interrupt handle
|
||||
* @return timestamp in seconds since FPGA Initialization
|
||||
* @return timestamp in microseconds since FPGA Initialization
|
||||
*/
|
||||
double HAL_ReadInterruptFallingTimestamp(HAL_InterruptHandle interruptHandle,
|
||||
int32_t* status);
|
||||
int64_t HAL_ReadInterruptFallingTimestamp(HAL_InterruptHandle interruptHandle,
|
||||
int32_t* status);
|
||||
|
||||
/**
|
||||
* Requests interrupts on a specific digital source.
|
||||
|
||||
Reference in New Issue
Block a user