mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
[wpilib] Remove MotorController::StopMotor() (#8483)
It does the same thing as Disable() in practice, and MotorSafety has its own StopMotor() function.
This commit is contained in:
@@ -54,6 +54,10 @@ bool PWMMotorController::GetInverted() const {
|
||||
void PWMMotorController::Disable() {
|
||||
m_pwm.SetDisabled();
|
||||
|
||||
if (m_simSpeed) {
|
||||
m_simSpeed.Set(0.0);
|
||||
}
|
||||
|
||||
for (auto& follower : m_nonowningFollowers) {
|
||||
follower->Disable();
|
||||
}
|
||||
@@ -63,19 +67,7 @@ void PWMMotorController::Disable() {
|
||||
}
|
||||
|
||||
void PWMMotorController::StopMotor() {
|
||||
// Don't use Set(0) as that will feed the watch kitty
|
||||
m_pwm.SetPulseTime(0_us);
|
||||
|
||||
if (m_simSpeed) {
|
||||
m_simSpeed.Set(0.0);
|
||||
}
|
||||
|
||||
for (auto& follower : m_nonowningFollowers) {
|
||||
follower->StopMotor();
|
||||
}
|
||||
for (auto& follower : m_owningFollowers) {
|
||||
follower->StopMotor();
|
||||
}
|
||||
Disable();
|
||||
}
|
||||
|
||||
std::string PWMMotorController::GetDescription() const {
|
||||
|
||||
@@ -61,11 +61,6 @@ class MotorController {
|
||||
* Common interface for disabling a motor.
|
||||
*/
|
||||
virtual void Disable() = 0;
|
||||
|
||||
/**
|
||||
* Common interface to stop the motor until Set is called again.
|
||||
*/
|
||||
virtual void StopMotor() = 0;
|
||||
};
|
||||
|
||||
} // namespace wpi
|
||||
|
||||
Reference in New Issue
Block a user