diff --git a/wpilibc/src/main/native/cpp/system/Watchdog.cpp b/wpilibc/src/main/native/cpp/system/Watchdog.cpp index 97ac70901f..01492fec3a 100644 --- a/wpilibc/src/main/native/cpp/system/Watchdog.cpp +++ b/wpilibc/src/main/native/cpp/system/Watchdog.cpp @@ -39,7 +39,7 @@ class Watchdog::Impl { DerefGreater> m_watchdogs; - void UpdateAlarm(bool acknowledge = false); + void UpdateAlarm(); private: void Main(); @@ -67,7 +67,7 @@ Watchdog::Impl::~Impl() { } } -void Watchdog::Impl::UpdateAlarm(bool acknowledge) { +void Watchdog::Impl::UpdateAlarm() { int32_t status = 0; // Return if we are being destructed, or were not created successfully auto notifier = m_notifier.load(); @@ -75,12 +75,12 @@ void Watchdog::Impl::UpdateAlarm(bool acknowledge) { return; } if (m_watchdogs.empty()) { - HAL_CancelNotifierAlarm(notifier, acknowledge, &status); + HAL_CancelNotifierAlarm(notifier, true, &status); } else { HAL_SetNotifierAlarm(notifier, static_cast( m_watchdogs.top()->m_expirationTime.value() * 1e6), - 0, true, acknowledge, &status); + 0, true, true, &status); } WPILIB_CheckErrorStatus(status, "updating watchdog notifier alarm"); } @@ -125,7 +125,7 @@ void Watchdog::Impl::Main() { watchdog->m_callback(); lock.lock(); - UpdateAlarm(true); + UpdateAlarm(); } } diff --git a/wpilibj/src/main/java/org/wpilib/system/Watchdog.java b/wpilibj/src/main/java/org/wpilib/system/Watchdog.java index 5fc31d853c..7e4bf9eb21 100644 --- a/wpilibj/src/main/java/org/wpilib/system/Watchdog.java +++ b/wpilibj/src/main/java/org/wpilib/system/Watchdog.java @@ -120,7 +120,7 @@ public class Watchdog implements Closeable, Comparable { m_watchdogs.remove(this); m_expirationTime = m_startTime + m_timeout; m_watchdogs.add(this); - updateAlarm(false); + updateAlarm(); } finally { m_queueMutex.unlock(); } @@ -194,7 +194,7 @@ public class Watchdog implements Closeable, Comparable { m_watchdogs.remove(this); m_expirationTime = m_startTime + m_timeout; m_watchdogs.add(this); - updateAlarm(false); + updateAlarm(); } finally { m_queueMutex.unlock(); } @@ -205,7 +205,7 @@ public class Watchdog implements Closeable, Comparable { m_queueMutex.lock(); try { m_watchdogs.remove(this); - updateAlarm(false); + updateAlarm(); } finally { m_queueMutex.unlock(); } @@ -223,12 +223,12 @@ public class Watchdog implements Closeable, Comparable { } @SuppressWarnings("resource") - private static void updateAlarm(boolean acknowledge) { + private static void updateAlarm() { if (m_watchdogs.isEmpty()) { - NotifierJNI.cancelNotifierAlarm(m_notifier, acknowledge); + NotifierJNI.cancelNotifierAlarm(m_notifier, true); } else { NotifierJNI.setNotifierAlarm( - m_notifier, (long) (m_watchdogs.peek().m_expirationTime * 1e6), 0, true, acknowledge); + m_notifier, (long) (m_watchdogs.peek().m_expirationTime * 1e6), 0, true, true); } } @@ -277,7 +277,7 @@ public class Watchdog implements Closeable, Comparable { watchdog.m_callback.run(); m_queueMutex.lock(); - updateAlarm(true); + updateAlarm(); } finally { m_queueMutex.unlock(); }