Remove brain-dead attempt at dealing with FPGA time wrapping
It took a lock in a bad place.
Also, if it was ever actually used, it would trigger undefined behavior
in various places in WPILib and our code that still use 32-bit ints for
the result...
Change-Id: I57672096ccead70815b770f31c9cada0557499f1
diff --git a/frc971/wpilib/dma_edge_counting.h b/frc971/wpilib/dma_edge_counting.h
index 6d88170..37f5837 100644
--- a/frc971/wpilib/dma_edge_counting.h
+++ b/frc971/wpilib/dma_edge_counting.h
@@ -189,7 +189,7 @@
::std::vector<DMASampleHandlerInterface *> handlers_;
// The time at which we most recently read the sensor values.
- uint32_t sample_time_ = 0.0;
+ uint32_t sample_time_ = 0;
DISALLOW_COPY_AND_ASSIGN(DMASynchronizer);
};
diff --git a/third_party/allwpilib_2016/hal/lib/Athena/HALAthena.cpp b/third_party/allwpilib_2016/hal/lib/Athena/HALAthena.cpp
index 3a392f1..f37fb78 100644
--- a/third_party/allwpilib_2016/hal/lib/Athena/HALAthena.cpp
+++ b/third_party/allwpilib_2016/hal/lib/Athena/HALAthena.cpp
@@ -206,6 +206,9 @@
*status = NiFpga_Status_ResourceNotInitialized;
return 0;
}
+#if 1
+ return global->readLocalTime(status);
+#else
std::lock_guard<priority_mutex> lock(timeMutex);
uint32_t fpgaTime = global->readLocalTime(status);
if (*status != 0) return 0;
@@ -213,6 +216,7 @@
if (fpgaTime < prevFPGATime) ++timeEpoch;
prevFPGATime = fpgaTime;
return (((uint64_t)timeEpoch) << 32) | ((uint64_t)fpgaTime);
+#endif
}
/**