Revert "MotorSafety: Use Watchdog instead of DS class polling (#1442)"

This reverts commit 26e8e587f9.
This commit is contained in:
Peter Johnson
2018-12-29 16:19:23 -08:00
parent 7c35355d29
commit f0f196e5b3
6 changed files with 154 additions and 49 deletions

View File

@@ -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();
}