mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01: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:
@@ -115,7 +115,7 @@ MotorSafety& MotorSafety::operator=(MotorSafety&& rhs) {
|
||||
|
||||
void MotorSafety::Feed() {
|
||||
std::scoped_lock lock(m_thisMutex);
|
||||
m_stopTime = Timer::GetFPGATimestamp() + m_expiration;
|
||||
m_stopTime = Timer::GetMonotonicTimestamp() + m_expiration;
|
||||
}
|
||||
|
||||
void MotorSafety::SetExpiration(wpi::units::second_t expirationTime) {
|
||||
@@ -130,7 +130,7 @@ wpi::units::second_t MotorSafety::GetExpiration() const {
|
||||
|
||||
bool MotorSafety::IsAlive() const {
|
||||
std::scoped_lock lock(m_thisMutex);
|
||||
return !m_enabled || m_stopTime > Timer::GetFPGATimestamp();
|
||||
return !m_enabled || m_stopTime > Timer::GetMonotonicTimestamp();
|
||||
}
|
||||
|
||||
void MotorSafety::SetSafetyEnabled(bool enabled) {
|
||||
@@ -157,7 +157,7 @@ void MotorSafety::Check() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (stopTime < Timer::GetFPGATimestamp()) {
|
||||
if (stopTime < Timer::GetMonotonicTimestamp()) {
|
||||
WPILIB_ReportError(
|
||||
err::Timeout,
|
||||
"{}... Output not updated often enough. See "
|
||||
|
||||
Reference in New Issue
Block a user