Browse Source

Minor "optimizations" in stepper ISR

Scott Lahteine 8 years ago
parent
commit
9725bcd099
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      Marlin/stepper.cpp

+ 3
- 3
Marlin/stepper.cpp View File

386
           #if DISABLED(MIXING_EXTRUDER)
386
           #if DISABLED(MIXING_EXTRUDER)
387
             // Don't step E here for mixing extruder
387
             // Don't step E here for mixing extruder
388
             count_position[E_AXIS] += count_direction[E_AXIS];
388
             count_position[E_AXIS] += count_direction[E_AXIS];
389
-            e_steps[TOOL_E_INDEX] += motor_direction(E_AXIS) ? -1 : 1;
389
+            motor_direction(E_AXIS) ? --e_steps[TOOL_E_INDEX] : ++e_steps[TOOL_E_INDEX];
390
           #endif
390
           #endif
391
         }
391
         }
392
 
392
 
599
     else if (step_events_completed > (uint32_t)current_block->decelerate_after) {
599
     else if (step_events_completed > (uint32_t)current_block->decelerate_after) {
600
       MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate);
600
       MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate);
601
 
601
 
602
-      if (step_rate <= acc_step_rate) { // Still decelerating?
602
+      if (step_rate < acc_step_rate) { // Still decelerating?
603
         step_rate = acc_step_rate - step_rate;
603
         step_rate = acc_step_rate - step_rate;
604
         NOLESS(step_rate, current_block->final_rate);
604
         NOLESS(step_rate, current_block->final_rate);
605
       }
605
       }
662
       step_loops = step_loops_nominal;
662
       step_loops = step_loops_nominal;
663
     }
663
     }
664
 
664
 
665
-    OCR1A = (OCR1A < (TCNT1 + 16)) ? (TCNT1 + 16) : OCR1A;
665
+    NOLESS(OCR1A, TCNT1 + 16);
666
 
666
 
667
     // If current block is finished, reset pointer
667
     // If current block is finished, reset pointer
668
     if (all_steps_done) {
668
     if (all_steps_done) {

Loading…
Cancel
Save