mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Performed cleanup of Timer's free functions (#776)
* GetClock() is now officially deprecated since its comment already informally did so and the function just forwards to Timer::GetFPGATimestamp(). * The declaration of GetPPCTimestamp() is missing a definition and has been removed. * std::this_thread::sleep_for() returns immediately when given a negative duration, so the check for that was removed from Wait().
This commit is contained in:
committed by
Peter Johnson
parent
dfc0656e5c
commit
26a36779a6
@@ -103,7 +103,7 @@ void Notifier::StartSingle(double delay) {
|
||||
std::lock_guard<wpi::mutex> lock(m_processMutex);
|
||||
m_periodic = false;
|
||||
m_period = delay;
|
||||
m_expirationTime = GetClock() + m_period;
|
||||
m_expirationTime = Timer::GetFPGATimestamp() + m_period;
|
||||
UpdateAlarm();
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ void Notifier::StartPeriodic(double period) {
|
||||
std::lock_guard<wpi::mutex> lock(m_processMutex);
|
||||
m_periodic = true;
|
||||
m_period = period;
|
||||
m_expirationTime = GetClock() + m_period;
|
||||
m_expirationTime = Timer::GetFPGATimestamp() + m_period;
|
||||
UpdateAlarm();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace frc {
|
||||
* @param seconds Length of time to pause, in seconds.
|
||||
*/
|
||||
void Wait(double seconds) {
|
||||
if (seconds < 0.0) return;
|
||||
std::this_thread::sleep_for(std::chrono::duration<double>(seconds));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user