From 8692748ecd10e194e9820fea0305de8087670ec3 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Mon, 19 Sep 2016 12:29:59 +0900 Subject: [PATCH] Fix broken direction signal of ADVANCED and LIN_ADVANCED Remove a setting proccess of E direction in advance_isr() --- Marlin/stepper.cpp | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 158e31dac9..4026cc2edb 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -299,16 +299,14 @@ void Stepper::set_directions() { SET_STEP_DIR(Z); // C #endif - #if DISABLED(ADVANCE) - if (motor_direction(E_AXIS)) { - REV_E_DIR(); - count_direction[E_AXIS] = -1; - } - else { - NORM_E_DIR(); - count_direction[E_AXIS] = 1; - } - #endif //!ADVANCE + if (motor_direction(E_AXIS)) { + REV_E_DIR(); + count_direction[E_AXIS] = -1; + } + else { + NORM_E_DIR(); + count_direction[E_AXIS] = 1; + } } // "The Stepper Driver Interrupt" - This timer interrupt is the workhorse. @@ -683,9 +681,6 @@ void Stepper::isr() { old_OCR0A += eISR_Rate; OCR0A = old_OCR0A; - #define SET_E_STEP_DIR(INDEX) \ - E## INDEX ##_DIR_WRITE(e_steps[INDEX] <= 0 ? INVERT_E## INDEX ##_DIR : !INVERT_E## INDEX ##_DIR) - #define START_E_PULSE(INDEX) \ if (e_steps[INDEX]) E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN) @@ -695,17 +690,6 @@ void Stepper::isr() { E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); \ } - SET_E_STEP_DIR(0); - #if E_STEPPERS > 1 - SET_E_STEP_DIR(1); - #if E_STEPPERS > 2 - SET_E_STEP_DIR(2); - #if E_STEPPERS > 3 - SET_E_STEP_DIR(3); - #endif - #endif - #endif - // Step all E steppers that have steps for (uint8_t i = 0; i < step_loops; i++) {