mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +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:
@@ -41,7 +41,7 @@ void TimedRobot::StartCompetition() {
|
||||
break;
|
||||
}
|
||||
|
||||
m_loopStartTimeUs = RobotController::GetFPGATime();
|
||||
m_loopStartTimeUs = RobotController::GetMonotonicTime();
|
||||
std::chrono::microseconds currentTime{m_loopStartTimeUs};
|
||||
|
||||
callback.func();
|
||||
@@ -76,7 +76,7 @@ void TimedRobot::EndCompetition() {
|
||||
|
||||
TimedRobot::TimedRobot(wpi::units::second_t period)
|
||||
: IterativeRobotBase(period) {
|
||||
m_startTime = std::chrono::microseconds{RobotController::GetFPGATime()};
|
||||
m_startTime = std::chrono::microseconds{RobotController::GetMonotonicTime()};
|
||||
AddPeriodic([=, this] { LoopFunc(); }, period);
|
||||
|
||||
int32_t status = 0;
|
||||
|
||||
Reference in New Issue
Block a user