Add methods for checking Watchdog status, ds status, and brownout status

Change-Id: I723c87d0c50612cbffbb81b0e039efd0ef05fcd0
This commit is contained in:
Kevin O'Connor
2014-11-18 10:56:25 -05:00
parent c7a90b2ccc
commit e73b3ed7b5
7 changed files with 89 additions and 0 deletions

View File

@@ -286,6 +286,29 @@ bool DriverStation::IsTest()
return m_controlWord.test;
}
bool DriverStation::IsDSAttached()
{
HALControlWord controlWord;
HALGetControlWord(&controlWord);
return controlWord.dsAttached;
}
bool DriverStation::IsSysActive()
{
int32_t status = 0;
bool retVal = HALGetSystemActive(&status);
wpi_setErrorWithContext(status, getHALErrorMessage(status));
return retVal;
}
bool DriverStation::IsSysBrownedOut()
{
int32_t status = 0;
bool retVal = HALGetBrownedOut(&status);
wpi_setErrorWithContext(status, getHALErrorMessage(status));
return retVal;
}
/**
* Has a new control packet from the driver station arrived since the last time this function was called?
* Warning: If you call this function from more than one place at the same time,