mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[hal,wpilib] Rename FPGA clock to monotonic clock (#8672)
- Remove status return from HAL level (clock getting should never fail) - Remove 32-bit timestamp expand function - Make monotonic_clock.hpp (formerly fpga_clock.hpp) header-only and move to root hal include directory
This commit is contained in:
@@ -69,7 +69,7 @@ class LEDPatternTest {
|
||||
|
||||
@AfterEach
|
||||
void tearDown() {
|
||||
RobotController.setTimeSource(RobotController::getFPGATime);
|
||||
RobotController.setTimeSource(RobotController::getMonotonicTime);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -127,10 +127,10 @@ class TimerTest {
|
||||
|
||||
@Test
|
||||
@ResourceLock("timing")
|
||||
void getFPGATimestampTest() {
|
||||
double start = Timer.getFPGATimestamp();
|
||||
void getMonotonicTimestampTest() {
|
||||
double start = Timer.getMonotonicTimestamp();
|
||||
SimHooks.stepTiming(0.5);
|
||||
double end = Timer.getFPGATimestamp();
|
||||
double end = Timer.getMonotonicTimestamp();
|
||||
assertEquals(start + 0.5, end, 1e-9);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user