diff --git a/libraries/Servo/src/Servo.h b/libraries/Servo/src/Servo.h index 5e52aba3da..162f9fff2d 100644 --- a/libraries/Servo/src/Servo.h +++ b/libraries/Servo/src/Servo.h @@ -110,8 +110,9 @@ class Servo { int read(); // returns current pulse width as an angle between 0 and 180 degrees int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release) bool attached(); // return true if this servo is attached, otherwise false - private: + protected: uint8_t servoIndex; // index into the channel data for this servo + private: int8_t min; // minimum is this value times 4 added to MIN_PULSE_WIDTH int8_t max; // maximum is this value times 4 added to MAX_PULSE_WIDTH }; diff --git a/libraries/Servo/src/stm32/Servo.cpp b/libraries/Servo/src/stm32/Servo.cpp index 2202d2a6be..484f4657e9 100644 --- a/libraries/Servo/src/stm32/Servo.cpp +++ b/libraries/Servo/src/stm32/Servo.cpp @@ -29,7 +29,7 @@ static volatile int8_t timerChannel[_Nbr_16timers] = {-1}; // counter for the se static HardwareTimer TimerServo(TIMER_SERVO); -uint8_t ServoCount = 0; // the total number of attached servos +static uint8_t ServoCount = 0; // the total number of attached servos #define SERVO_MIN() (MIN_PULSE_WIDTH - this->min * 4) // minimum value in uS for this servo #define SERVO_MAX() (MAX_PULSE_WIDTH - this->max * 4) // maximum value in uS for this servo