From c02fe74ecd5e07d930bd4f7b819d4c6848fb84d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 3 Nov 2019 21:36:00 +0100 Subject: [PATCH] Some reformatting to layout rules --- Adafruit_PWMServoDriver.cpp | 12 ++++++++---- Adafruit_PWMServoDriver.h | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Adafruit_PWMServoDriver.cpp b/Adafruit_PWMServoDriver.cpp index a6a33ed..50e492e 100755 --- a/Adafruit_PWMServoDriver.cpp +++ b/Adafruit_PWMServoDriver.cpp @@ -108,10 +108,12 @@ void Adafruit_PWMServoDriver::wakeup() { * @param prescale * Defines the frequency at which the outputs modulate * @param extclk - * Sets EXTCLK pin to use the external clock + * Sets EXTCLK pin to use the external clock, default false */ -void Adafruit_PWMServoDriver::setPrescale(uint8_t prescale, bool extclk /* = false */) { - if (prescale < PCA9685_PRESCALE_MIN) return; +void Adafruit_PWMServoDriver::setPrescale(uint8_t prescale, + bool extclk) { + if (prescale < PCA9685_PRESCALE_MIN) + return; // if (prescale > PCA9685_PRESCALE_MAX) return; uint8_t newmode1 = read8(PCA9685_MODE1); @@ -120,7 +122,9 @@ void Adafruit_PWMServoDriver::setPrescale(uint8_t prescale, bool extclk /* = fal // This sets both the SLEEP and EXTCLK bits of the MODE1 register to switch to // use the external clock. - if (extclk) { write8(PCA9685_MODE1, (newmode1 |= MODE1_EXTCLK)); } + if (extclk) { + write8(PCA9685_MODE1, (newmode1 |= MODE1_EXTCLK)); + } write8(PCA9685_PRESCALE, prescale); // set the prescaler diff --git a/Adafruit_PWMServoDriver.h b/Adafruit_PWMServoDriver.h index f9680d5..92705ca 100644 --- a/Adafruit_PWMServoDriver.h +++ b/Adafruit_PWMServoDriver.h @@ -81,7 +81,7 @@ class Adafruit_PWMServoDriver { void reset(); void sleep(); void wakeup(); - void setPrescale(uint8_t prescale, bool extclk=false); + void setPrescale(uint8_t prescale, bool extclk = false); void setExtClk(uint8_t prescale); void setPWMFreq(float freq); void setOutputMode(bool totempole);