Keep track of FPGA time rollovers with 64-bit time.

This allows both greater than 72 minute (2^32 * 1 us) timeouts and also
gracefully handles notifiers across the FPGA time counter rollover.

Change-Id: Ibde0b903155f60b618b0ca4d5f8f6dd49f90b020
This commit is contained in:
Peter Johnson
2015-12-30 19:06:47 -08:00
committed by Brad Miller (WPI)
parent 063925e737
commit e2ec34090a
13 changed files with 71 additions and 43 deletions

View File

@@ -156,9 +156,9 @@ uint32_t GetFPGARevision() {
* @return The current time in microseconds according to the FPGA (since FPGA
* reset).
*/
uint32_t GetFPGATime() {
uint64_t GetFPGATime() {
int32_t status = 0;
uint32_t time = getFPGATime(&status);
uint64_t time = getFPGATime(&status);
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
return time;
}