Ver código fonte

Merge pull request #2149 from Wurstnase/enstop_bits

faster compare
Wurstnase 9 anos atrás
pai
commit
9c09967803
1 arquivos alterados com 5 adições e 6 exclusões
  1. 5
    6
      Marlin/stepper.cpp

+ 5
- 6
Marlin/stepper.cpp Ver arquivo

@@ -566,8 +566,8 @@ ISR(TIMER1_COMPA_vect) {
566 566
             if (z_test && current_block->steps[Z_AXIS] > 0) { // z_test = Z_MIN || Z2_MIN
567 567
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
568 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 572
           #else // !Z_DUAL_ENDSTOPS
573 573
 
@@ -577,7 +577,6 @@ ISR(TIMER1_COMPA_vect) {
577 577
 
578 578
         #ifdef Z_PROBE_ENDSTOP
579 579
           UPDATE_ENDSTOP(Z, PROBE);
580
-          SET_ENDSTOP_BIT(Z, PROBE);
581 580
 
582 581
           if (TEST_ENDSTOP(Z_PROBE))
583 582
           {
@@ -603,8 +602,8 @@ ISR(TIMER1_COMPA_vect) {
603 602
             if (z_test && current_block->steps[Z_AXIS] > 0) {  // t_test = Z_MAX || Z2_MAX
604 603
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
605 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 609
           #else // !Z_DUAL_ENDSTOPS
@@ -616,7 +615,7 @@ ISR(TIMER1_COMPA_vect) {
616 615
         
617 616
         #ifdef Z_PROBE_ENDSTOP
618 617
           UPDATE_ENDSTOP(Z, PROBE);
619
-          SET_ENDSTOP_BIT(Z, PROBE);
618
+          
620 619
           if (TEST_ENDSTOP(Z_PROBE))
621 620
           {
622 621
             endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];

Carregando…
Cancelar
Salvar