diff --git a/Marlin/src/HAL/AVR/Servo.cpp b/Marlin/src/HAL/AVR/Servo.cpp index 379eb08215..676cfd04db 100644 --- a/Marlin/src/HAL/AVR/Servo.cpp +++ b/Marlin/src/HAL/AVR/Servo.cpp @@ -70,8 +70,8 @@ static inline void handle_interrupts(const timer16_Sequence_t timer, volatile ui const bool good_servo = SERVO_INDEX(timer, Channel[timer]) < ServoCount; if (Channel[timer] < 0) *TCNTn = 0; // channel set to -1 indicated that refresh interval completed so reset the timer - else if (good_servo && SERVO(timer, Channel[timer]).Pin.isActive) - extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // pulse this channel low if activated + else if (good_servo) + extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // always pulse the channel LOW Channel[timer]++; // increment to the next channel if (good_servo && Channel[timer] < SERVOS_PER_TIMER) { diff --git a/Marlin/src/HAL/DUE/Servo.cpp b/Marlin/src/HAL/DUE/Servo.cpp index c527de01d9..a04f0e4aa7 100644 --- a/Marlin/src/HAL/DUE/Servo.cpp +++ b/Marlin/src/HAL/DUE/Servo.cpp @@ -74,8 +74,8 @@ void Servo_Handler(const timer16_Sequence_t timer, Tc *tc, const uint8_t channel const bool good_servo = SERVO_INDEX(timer, Channel[timer]) < ServoCount; if (Channel[timer] < 0) tc->TC_CHANNEL[channel].TC_CCR |= TC_CCR_SWTRG; // channel set to -1 indicated that refresh interval completed so reset the timer - else if (good_servo && SERVO(timer, Channel[timer]).Pin.isActive) - extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // pulse this channel low if activated + else if (good_servo) + extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // always pulse the channel low tc->TC_CHANNEL[channel].TC_SR; // clear interrupt diff --git a/Marlin/src/HAL/shared/servo.cpp b/Marlin/src/HAL/shared/servo.cpp index 4e424aa81e..baf4246fc2 100644 --- a/Marlin/src/HAL/shared/servo.cpp +++ b/Marlin/src/HAL/shared/servo.cpp @@ -109,10 +109,10 @@ int8_t Servo::attach(const int inPin, const int inMin, const int inMax) { } void Servo::detach() { + servo_info[servoIndex].Pin.isActive = false; const timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex); if (anyTimerChannelActive(timer)) finISR(timer); - servo_info[servoIndex].Pin.isActive = false; - //extDigitalWrite(servo_info[servoIndex].Pin.nbr, LOW); // The ISR won't be called, so set the pin LOW here + pinMode(servo_info[servoIndex].Pin.nbr, INPUT); // set servo pin to input } void Servo::write(int value) {