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

This commit is contained in:
Tyler Veness
2018-12-01 01:34:52 -08:00
committed by Peter Johnson
parent 0d0492bfcc
commit 26e8e587f9
6 changed files with 49 additions and 154 deletions

View File

@@ -1116,20 +1116,10 @@ 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();
}