mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilib] Propagate PWMMotorController stopMotor() and disable() to followers (#6750)
This commit is contained in:
@@ -47,11 +47,25 @@ bool PWMMotorController::GetInverted() const {
|
||||
|
||||
void PWMMotorController::Disable() {
|
||||
m_pwm.SetDisabled();
|
||||
|
||||
for (auto& follower : m_nonowningFollowers) {
|
||||
follower->Disable();
|
||||
}
|
||||
for (auto& follower : m_owningFollowers) {
|
||||
follower->Disable();
|
||||
}
|
||||
}
|
||||
|
||||
void PWMMotorController::StopMotor() {
|
||||
// Don't use Set(0) as that will feed the watch kitty
|
||||
m_pwm.SetSpeed(0);
|
||||
|
||||
for (auto& follower : m_nonowningFollowers) {
|
||||
follower->StopMotor();
|
||||
}
|
||||
for (auto& follower : m_owningFollowers) {
|
||||
follower->StopMotor();
|
||||
}
|
||||
}
|
||||
|
||||
std::string PWMMotorController::GetDescription() const {
|
||||
|
||||
Reference in New Issue
Block a user