mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +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:
@@ -28,11 +28,17 @@ Servo::Servo(int channel) : PWM(channel) {
|
||||
SendableRegistry::GetInstance().SetName(this, "Servo", channel);
|
||||
}
|
||||
|
||||
void Servo::Set(double value) { SetPosition(value); }
|
||||
void Servo::Set(double value) {
|
||||
SetPosition(value);
|
||||
}
|
||||
|
||||
void Servo::SetOffline() { SetRaw(0); }
|
||||
void Servo::SetOffline() {
|
||||
SetRaw(0);
|
||||
}
|
||||
|
||||
double Servo::Get() const { return GetPosition(); }
|
||||
double Servo::Get() const {
|
||||
return GetPosition();
|
||||
}
|
||||
|
||||
void Servo::SetAngle(double degrees) {
|
||||
if (degrees < kMinServoAngle) {
|
||||
@@ -48,9 +54,13 @@ double Servo::GetAngle() const {
|
||||
return GetPosition() * GetServoAngleRange() + kMinServoAngle;
|
||||
}
|
||||
|
||||
double Servo::GetMaxAngle() const { return kMaxServoAngle; }
|
||||
double Servo::GetMaxAngle() const {
|
||||
return kMaxServoAngle;
|
||||
}
|
||||
|
||||
double Servo::GetMinAngle() const { return kMinServoAngle; }
|
||||
double Servo::GetMinAngle() const {
|
||||
return kMinServoAngle;
|
||||
}
|
||||
|
||||
void Servo::InitSendable(SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("Servo");
|
||||
|
||||
Reference in New Issue
Block a user