Browse Source

Try bool for direction instead of long

Scott Lahteine 9 years ago
parent
commit
42b5616327
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      Marlin/stepper.cpp

+ 5
- 5
Marlin/stepper.cpp View File

392
 
392
 
393
         #if ENABLED(MIXING_EXTRUDER)
393
         #if ENABLED(MIXING_EXTRUDER)
394
           // Step mixing steppers proportionally
394
           // Step mixing steppers proportionally
395
-          long dir = motor_direction(E_AXIS) ? -1 : 1;
395
+          bool dir = motor_direction(E_AXIS);
396
           MIXING_STEPPERS_LOOP(j) {
396
           MIXING_STEPPERS_LOOP(j) {
397
             counter_m[j] += current_block->steps[E_AXIS];
397
             counter_m[j] += current_block->steps[E_AXIS];
398
             if (counter_m[j] > 0) {
398
             if (counter_m[j] > 0) {
399
               counter_m[j] -= current_block->mix_event_count[j];
399
               counter_m[j] -= current_block->mix_event_count[j];
400
-              e_steps[j] += dir;
400
+              dir ? --e_steps[j] : ++e_steps[j];
401
             }
401
             }
402
           }
402
           }
403
         #endif
403
         #endif
433
         #if ENABLED(MIXING_EXTRUDER)
433
         #if ENABLED(MIXING_EXTRUDER)
434
 
434
 
435
           // Step mixing steppers proportionally
435
           // Step mixing steppers proportionally
436
-          long dir = motor_direction(E_AXIS) ? -1 : 1;
436
+          bool dir = motor_direction(E_AXIS);
437
           MIXING_STEPPERS_LOOP(j) {
437
           MIXING_STEPPERS_LOOP(j) {
438
             counter_m[j] += current_block->steps[E_AXIS];
438
             counter_m[j] += current_block->steps[E_AXIS];
439
             if (counter_m[j] > 0) {
439
             if (counter_m[j] > 0) {
440
               counter_m[j] -= current_block->mix_event_count[j];
440
               counter_m[j] -= current_block->mix_event_count[j];
441
-              e_steps[j] += dir;
441
+              dir ? --e_steps[j] : ++e_steps[j];
442
             }
442
             }
443
           }
443
           }
444
 
444
 
691
 
691
 
692
     #define STOP_E_PULSE(INDEX) \
692
     #define STOP_E_PULSE(INDEX) \
693
       if (e_steps[INDEX]) { \
693
       if (e_steps[INDEX]) { \
694
-        e_steps[INDEX] < 0 ? ++e_steps[INDEX] : --e_steps[INDEX]; \
694
+        e_steps[INDEX] <= 0 ? ++e_steps[INDEX] : --e_steps[INDEX]; \
695
         E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); \
695
         E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); \
696
       }
696
       }
697
 
697
 

Loading…
Cancel
Save