mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Add robot callback that is called when the DS is initially connected (#5231)
This commit is contained in:
@@ -24,6 +24,8 @@ IterativeRobotBase::IterativeRobotBase(units::second_t period)
|
||||
|
||||
void IterativeRobotBase::RobotInit() {}
|
||||
|
||||
void IterativeRobotBase::DriverStationConnected() {}
|
||||
|
||||
void IterativeRobotBase::SimulationInit() {}
|
||||
|
||||
void IterativeRobotBase::DisabledInit() {}
|
||||
@@ -127,6 +129,11 @@ void IterativeRobotBase::LoopFunc() {
|
||||
mode = Mode::kTest;
|
||||
}
|
||||
|
||||
if (!m_calledDsConnected && word.IsDSAttached()) {
|
||||
m_calledDsConnected = true;
|
||||
DriverStationConnected();
|
||||
}
|
||||
|
||||
// If mode changed, call mode exit and entry functions
|
||||
if (m_lastMode != mode) {
|
||||
// Call last mode's exit function
|
||||
|
||||
Reference in New Issue
Block a user