From a6628f12cc8fa255544b14cb8cc41ed8e7eb71ff Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 15 Jul 2015 12:11:42 +0200 Subject: [PATCH] Eliminate the further use of the pin-parameter --- Marlin/servo.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Marlin/servo.cpp b/Marlin/servo.cpp index a7e9b867f..97def9ea0 100644 --- a/Marlin/servo.cpp +++ b/Marlin/servo.cpp @@ -244,10 +244,9 @@ uint8_t Servo::attach(int pin) { uint8_t Servo::attach(int pin, int min, int max) { if (this->servoIndex < MAX_SERVOS ) { - if(pin == 0) - pin = servos[this->servoIndex].Pin.nbr; - pinMode(pin, OUTPUT); // set servo pin to output - servos[this->servoIndex].Pin.nbr = pin; + if(pin > 0) + servos[this->servoIndex].Pin.nbr = pin; + pinMode(servos[this->servoIndex].Pin.nbr, OUTPUT); // set servo pin to output // todo min/max check: abs(min - MIN_PULSE_WIDTH) /4 < 128 this->min = (MIN_PULSE_WIDTH - min) / 4; //resolution of min/max is 4 uS this->max = (MAX_PULSE_WIDTH - max) / 4;