Less use of "this"

This commit is contained in:
Scott Lahteine
2019-09-25 08:29:59 -05:00
parent 661c3cfc99
commit 0b4aedf13e
14 changed files with 245 additions and 248 deletions

View File

@ -57,11 +57,11 @@ class libServo: public Servo {
constexpr uint16_t servo_delay[] = SERVO_DELAY;
static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
if (this->attach(servo_info[this->servoIndex].Pin.nbr) >= 0) { // try to reattach
this->write(value);
safe_delay(servo_delay[this->servoIndex]); // delay to allow servo to reach position
if (attach(servo_info[servoIndex].Pin.nbr) >= 0) { // try to reattach
write(value);
safe_delay(servo_delay[servoIndex]); // delay to allow servo to reach position
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
this->detach();
detach();
#endif
}