diff --git a/wpilibc/src/main/native/cpp/Notifier.cpp b/wpilibc/src/main/native/cpp/Notifier.cpp index 06dfb0d8b0..74ad7c9cf2 100644 --- a/wpilibc/src/main/native/cpp/Notifier.cpp +++ b/wpilibc/src/main/native/cpp/Notifier.cpp @@ -103,7 +103,7 @@ void Notifier::StartSingle(double delay) { std::lock_guard 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 lock(m_processMutex); m_periodic = true; m_period = period; - m_expirationTime = GetClock() + m_period; + m_expirationTime = Timer::GetFPGATimestamp() + m_period; UpdateAlarm(); } diff --git a/wpilibc/src/main/native/cpp/Timer.cpp b/wpilibc/src/main/native/cpp/Timer.cpp index 145de5470d..e216d55283 100644 --- a/wpilibc/src/main/native/cpp/Timer.cpp +++ b/wpilibc/src/main/native/cpp/Timer.cpp @@ -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(seconds)); } diff --git a/wpilibc/src/main/native/include/Timer.h b/wpilibc/src/main/native/include/Timer.h index f10fdfb3da..64cf83d1a3 100644 --- a/wpilibc/src/main/native/include/Timer.h +++ b/wpilibc/src/main/native/include/Timer.h @@ -7,6 +7,7 @@ #pragma once +#include #include #include "Base.h" @@ -16,6 +17,7 @@ namespace frc { typedef void (*TimerInterruptHandler)(void* param); void Wait(double seconds); +WPI_DEPRECATED("Use Timer::GetFPGATimestamp() instead.") double GetClock(); double GetTime(); @@ -43,7 +45,6 @@ class Timer { bool HasPeriodPassed(double period); static double GetFPGATimestamp(); - static double GetPPCTimestamp(); static double GetMatchTime(); // The time, in seconds, at which the 32-bit FPGA timestamp rolls over to 0