From 42b56163273e6210e3219f8d8cd839b7e5bd9752 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 2 Sep 2016 11:28:48 -0500 Subject: [PATCH] Try bool for direction instead of long --- Marlin/stepper.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 51459602f0..c03ea4a2c9 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -392,12 +392,12 @@ void Stepper::isr() { #if ENABLED(MIXING_EXTRUDER) // Step mixing steppers proportionally - long dir = motor_direction(E_AXIS) ? -1 : 1; + bool dir = motor_direction(E_AXIS); MIXING_STEPPERS_LOOP(j) { counter_m[j] += current_block->steps[E_AXIS]; if (counter_m[j] > 0) { counter_m[j] -= current_block->mix_event_count[j]; - e_steps[j] += dir; + dir ? --e_steps[j] : ++e_steps[j]; } } #endif @@ -433,12 +433,12 @@ void Stepper::isr() { #if ENABLED(MIXING_EXTRUDER) // Step mixing steppers proportionally - long dir = motor_direction(E_AXIS) ? -1 : 1; + bool dir = motor_direction(E_AXIS); MIXING_STEPPERS_LOOP(j) { counter_m[j] += current_block->steps[E_AXIS]; if (counter_m[j] > 0) { counter_m[j] -= current_block->mix_event_count[j]; - e_steps[j] += dir; + dir ? --e_steps[j] : ++e_steps[j]; } } @@ -691,7 +691,7 @@ void Stepper::isr() { #define STOP_E_PULSE(INDEX) \ if (e_steps[INDEX]) { \ - e_steps[INDEX] < 0 ? ++e_steps[INDEX] : --e_steps[INDEX]; \ + e_steps[INDEX] <= 0 ? ++e_steps[INDEX] : --e_steps[INDEX]; \ E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); \ }