mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Add braces to C++ single-line loops and conditionals (NFC) (#2973)
This makes code easier to read and more consistent between C++ and Java. Also update clang-format settings to always add a line break (even if no braces are used).
This commit is contained in:
@@ -12,19 +12,29 @@ void PWMSpeedController::Set(double speed) {
|
||||
SetSpeed(m_isInverted ? -speed : speed);
|
||||
}
|
||||
|
||||
double PWMSpeedController::Get() const { return GetSpeed(); }
|
||||
double PWMSpeedController::Get() const {
|
||||
return GetSpeed();
|
||||
}
|
||||
|
||||
void PWMSpeedController::SetInverted(bool isInverted) {
|
||||
m_isInverted = isInverted;
|
||||
}
|
||||
|
||||
bool PWMSpeedController::GetInverted() const { return m_isInverted; }
|
||||
bool PWMSpeedController::GetInverted() const {
|
||||
return m_isInverted;
|
||||
}
|
||||
|
||||
void PWMSpeedController::Disable() { SetDisabled(); }
|
||||
void PWMSpeedController::Disable() {
|
||||
SetDisabled();
|
||||
}
|
||||
|
||||
void PWMSpeedController::StopMotor() { PWM::StopMotor(); }
|
||||
void PWMSpeedController::StopMotor() {
|
||||
PWM::StopMotor();
|
||||
}
|
||||
|
||||
void PWMSpeedController::PIDWrite(double output) { Set(output); }
|
||||
void PWMSpeedController::PIDWrite(double output) {
|
||||
Set(output);
|
||||
}
|
||||
|
||||
PWMSpeedController::PWMSpeedController(int channel) : PWM(channel) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user