[wpilib] Add way to silence joystick connection warnings (#2845)

Warnings cannot be silenced when connected to FMS.
This commit is contained in:
Prateek Machiraju
2020-11-14 15:00:56 -05:00
committed by GitHub
parent 7a73946ce1
commit 2ef67f20a7
5 changed files with 121 additions and 8 deletions

View File

@@ -431,6 +431,23 @@ class DriverStation : public ErrorBase {
*/
void WakeupWaitForData();
/**
* Allows the user to specify whether they want joystick connection warnings
* to be printed to the console. This setting is ignored when the FMS is
* connected -- warnings will always be on in that scenario.
*
* @param silence Whether warning messages should be silenced.
*/
void SilenceJoystickConnectionWarning(bool silence);
/**
* Returns whether joystick connection warnings are silenced. This will
* always return false when connected to the FMS.
*
* @return Whether joystick connection warnings are silenced.
*/
bool IsJoystickConnectionWarningSilenced() const;
protected:
/**
* Copy data from the DS task for the user.
@@ -482,6 +499,8 @@ class DriverStation : public ErrorBase {
wpi::condition_variable m_waitForDataCond;
int m_waitForDataCounter;
bool m_silenceJoystickWarning = false;
// Robot state status variables
bool m_userInDisabled = false;
bool m_userInAutonomous = false;