mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
Add methods for checking Watchdog status, ds status, and brownout status
Change-Id: I723c87d0c50612cbffbb81b0e039efd0ef05fcd0
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user