mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -17,7 +17,7 @@
|
||||
#include "wpi/util/mutex.hpp"
|
||||
#include "wpi/util/priority_queue.hpp"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi;
|
||||
|
||||
class Watchdog::Impl {
|
||||
public:
|
||||
@@ -31,9 +31,9 @@ class Watchdog::Impl {
|
||||
}
|
||||
};
|
||||
|
||||
wpi::mutex m_mutex;
|
||||
wpi::util::mutex m_mutex;
|
||||
std::atomic<HAL_NotifierHandle> m_notifier;
|
||||
wpi::priority_queue<Watchdog*, std::vector<Watchdog*>,
|
||||
wpi::util::priority_queue<Watchdog*, std::vector<Watchdog*>,
|
||||
DerefGreater<Watchdog*>>
|
||||
m_watchdogs;
|
||||
|
||||
@@ -110,7 +110,7 @@ void Watchdog::Impl::Main() {
|
||||
// has occurred, so call its timeout function.
|
||||
auto watchdog = m_watchdogs.pop();
|
||||
|
||||
units::second_t now{curTime * 1e-6};
|
||||
wpi::units::second_t now{curTime * 1e-6};
|
||||
if (now - watchdog->m_lastTimeoutPrintTime > kMinPrintPeriod) {
|
||||
watchdog->m_lastTimeoutPrintTime = now;
|
||||
if (!watchdog->m_suppressTimeoutMessage) {
|
||||
@@ -132,7 +132,7 @@ void Watchdog::Impl::Main() {
|
||||
}
|
||||
}
|
||||
|
||||
Watchdog::Watchdog(units::second_t timeout, std::function<void()> callback)
|
||||
Watchdog::Watchdog(wpi::units::second_t timeout, std::function<void()> callback)
|
||||
: m_timeout(timeout), m_callback(std::move(callback)), m_impl(GetImpl()) {}
|
||||
|
||||
Watchdog::~Watchdog() {
|
||||
@@ -165,11 +165,11 @@ Watchdog& Watchdog::operator=(Watchdog&& rhs) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
units::second_t Watchdog::GetTime() const {
|
||||
wpi::units::second_t Watchdog::GetTime() const {
|
||||
return Timer::GetFPGATimestamp() - m_startTime;
|
||||
}
|
||||
|
||||
void Watchdog::SetTimeout(units::second_t timeout) {
|
||||
void Watchdog::SetTimeout(wpi::units::second_t timeout) {
|
||||
m_startTime = Timer::GetFPGATimestamp();
|
||||
m_tracer.ClearEpochs();
|
||||
|
||||
@@ -183,7 +183,7 @@ void Watchdog::SetTimeout(units::second_t timeout) {
|
||||
m_impl->UpdateAlarm();
|
||||
}
|
||||
|
||||
units::second_t Watchdog::GetTimeout() const {
|
||||
wpi::units::second_t Watchdog::GetTimeout() const {
|
||||
std::scoped_lock lock(m_impl->m_mutex);
|
||||
return m_timeout;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user