diff --git a/libraries/Servo/src/nrf52/Servo.cpp b/libraries/Servo/src/nrf52/Servo.cpp index 0d4f6b16..02995550 100644 --- a/libraries/Servo/src/nrf52/Servo.cpp +++ b/libraries/Servo/src/nrf52/Servo.cpp @@ -129,7 +129,7 @@ void Servo::write(int value) void Servo::writeMicroseconds(int value) { - if (this->pwm) { // pwm is only set when this->servoIndex != INVALID_SERVO + if (this->pwm) { uint8_t pin = servos[this->servoIndex].Pin.nbr; this->pwm->writePin(pin, value/DUTY_CYCLE_RESOLUTION); } @@ -142,7 +142,7 @@ int Servo::read() // return the value as degrees int Servo::readMicroseconds() { - if (this->pwm) { // pwm is only set when this->servoIndex != INVALID_SERVO + if (this->pwm) { uint8_t pin = servos[this->servoIndex].Pin.nbr; return this->pwm->readPin(pin)*DUTY_CYCLE_RESOLUTION; }