Browse Source

Merge pull request #2149 from Wurstnase/enstop_bits

faster compare
Wurstnase 9 years ago
parent
commit
9c09967803
1 changed files with 5 additions and 6 deletions
  1. 5
    6
      Marlin/stepper.cpp

+ 5
- 6
Marlin/stepper.cpp View File

566
             if (z_test && current_block->steps[Z_AXIS] > 0) { // z_test = Z_MIN || Z2_MIN
566
             if (z_test && current_block->steps[Z_AXIS] > 0) { // z_test = Z_MIN || Z2_MIN
567
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
567
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
568
               endstop_hit_bits |= BIT(Z_MIN);
568
               endstop_hit_bits |= BIT(Z_MIN);
569
-              if (!performing_homing || (performing_homing && !((~z_test) & 0x3)))  //if not performing home or if both endstops were trigged during homing...
570
-                step_events_completed = current_block->step_event_count;            //!((~z_test) & 0x3) = Z_MIN && Z2_MIN
569
+              if (!performing_homing || (z_test == 0x3))  //if not performing home or if both endstops were trigged during homing...
570
+                step_events_completed = current_block->step_event_count;
571
             }
571
             }
572
           #else // !Z_DUAL_ENDSTOPS
572
           #else // !Z_DUAL_ENDSTOPS
573
 
573
 
577
 
577
 
578
         #ifdef Z_PROBE_ENDSTOP
578
         #ifdef Z_PROBE_ENDSTOP
579
           UPDATE_ENDSTOP(Z, PROBE);
579
           UPDATE_ENDSTOP(Z, PROBE);
580
-          SET_ENDSTOP_BIT(Z, PROBE);
581
 
580
 
582
           if (TEST_ENDSTOP(Z_PROBE))
581
           if (TEST_ENDSTOP(Z_PROBE))
583
           {
582
           {
603
             if (z_test && current_block->steps[Z_AXIS] > 0) {  // t_test = Z_MAX || Z2_MAX
602
             if (z_test && current_block->steps[Z_AXIS] > 0) {  // t_test = Z_MAX || Z2_MAX
604
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
603
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
605
               endstop_hit_bits |= BIT(Z_MIN);
604
               endstop_hit_bits |= BIT(Z_MIN);
606
-              if (!performing_homing || (performing_homing && !((~z_test) & 0x3)))  //if not performing home or if both endstops were trigged during homing...
607
-                step_events_completed = current_block->step_event_count;            //!((~z_test) & 0x3) = Z_MAX && Z2_MAX
605
+              if (!performing_homing || (z_test == 0x3))  //if not performing home or if both endstops were trigged during homing...
606
+                step_events_completed = current_block->step_event_count;
608
             }
607
             }
609
 
608
 
610
           #else // !Z_DUAL_ENDSTOPS
609
           #else // !Z_DUAL_ENDSTOPS
616
         
615
         
617
         #ifdef Z_PROBE_ENDSTOP
616
         #ifdef Z_PROBE_ENDSTOP
618
           UPDATE_ENDSTOP(Z, PROBE);
617
           UPDATE_ENDSTOP(Z, PROBE);
619
-          SET_ENDSTOP_BIT(Z, PROBE);
618
+          
620
           if (TEST_ENDSTOP(Z_PROBE))
619
           if (TEST_ENDSTOP(Z_PROBE))
621
           {
620
           {
622
             endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
621
             endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];

Loading…
Cancel
Save