Skip to content

Commit c02fe74

Browse files
committed
Some reformatting to layout rules
1 parent 601d76e commit c02fe74

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Adafruit_PWMServoDriver.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ void Adafruit_PWMServoDriver::wakeup() {
108108
* @param prescale
109109
* Defines the frequency at which the outputs modulate
110110
* @param extclk
111-
* Sets EXTCLK pin to use the external clock
111+
* Sets EXTCLK pin to use the external clock, default false
112112
*/
113-
void Adafruit_PWMServoDriver::setPrescale(uint8_t prescale, bool extclk /* = false */) {
114-
if (prescale < PCA9685_PRESCALE_MIN) return;
113+
void Adafruit_PWMServoDriver::setPrescale(uint8_t prescale,
114+
bool extclk) {
115+
if (prescale < PCA9685_PRESCALE_MIN)
116+
return;
115117
// if (prescale > PCA9685_PRESCALE_MAX) return;
116118

117119
uint8_t newmode1 = read8(PCA9685_MODE1);
@@ -120,7 +122,9 @@ void Adafruit_PWMServoDriver::setPrescale(uint8_t prescale, bool extclk /* = fal
120122

121123
// This sets both the SLEEP and EXTCLK bits of the MODE1 register to switch to
122124
// use the external clock.
123-
if (extclk) { write8(PCA9685_MODE1, (newmode1 |= MODE1_EXTCLK)); }
125+
if (extclk) {
126+
write8(PCA9685_MODE1, (newmode1 |= MODE1_EXTCLK));
127+
}
124128

125129
write8(PCA9685_PRESCALE, prescale); // set the prescaler
126130

Adafruit_PWMServoDriver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Adafruit_PWMServoDriver {
8181
void reset();
8282
void sleep();
8383
void wakeup();
84-
void setPrescale(uint8_t prescale, bool extclk=false);
84+
void setPrescale(uint8_t prescale, bool extclk = false);
8585
void setExtClk(uint8_t prescale);
8686
void setPWMFreq(float freq);
8787
void setOutputMode(bool totempole);

0 commit comments

Comments
 (0)