mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
Revert "MotorSafety: Use Watchdog instead of DS class polling (#1442)"
This reverts commit 26e8e587f9.
This commit is contained in:
@@ -1116,10 +1116,20 @@ public class DriverStation {
|
||||
* Provides the service routine for the DS polling m_thread.
|
||||
*/
|
||||
private void run() {
|
||||
int safetyCounter = 0;
|
||||
while (m_threadKeepAlive) {
|
||||
HAL.waitForDSData();
|
||||
getData();
|
||||
|
||||
if (isDisabled()) {
|
||||
safetyCounter = 0;
|
||||
}
|
||||
|
||||
safetyCounter++;
|
||||
if (safetyCounter >= 4) {
|
||||
MotorSafety.checkMotors();
|
||||
safetyCounter = 0;
|
||||
}
|
||||
if (m_userInDisabled) {
|
||||
HAL.observeUserProgramDisabled();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user