|
@@ -515,31 +515,36 @@ ISR(TIMER1_COMPA_vect) {
|
515
|
515
|
}
|
516
|
516
|
|
517
|
517
|
if (TEST(out_bits, Z_AXIS)) { // -direction
|
|
518
|
+
|
518
|
519
|
Z_APPLY_DIR(INVERT_Z_DIR,0);
|
519
|
520
|
count_direction[Z_AXIS] = -1;
|
520
|
|
- if (check_endstops)
|
521
|
|
- {
|
522
|
|
- #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1
|
523
|
|
- #ifndef Z_DUAL_ENDSTOPS
|
524
|
|
- UPDATE_ENDSTOP(z, Z, min, MIN);
|
525
|
|
- #else
|
526
|
|
- bool z_min_endstop=(READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
527
|
|
- #if defined(Z2_MIN_PIN) && Z2_MIN_PIN > -1
|
528
|
|
- bool z2_min_endstop=(READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING);
|
529
|
|
- #else
|
530
|
|
- bool z2_min_endstop=z_min_endstop;
|
531
|
|
- #endif
|
532
|
|
- if(((z_min_endstop && old_z_min_endstop) || (z2_min_endstop && old_z2_min_endstop)) && (current_block->steps[Z_AXIS] > 0))
|
533
|
|
- {
|
|
521
|
+
|
|
522
|
+ if (check_endstops) {
|
|
523
|
+
|
|
524
|
+ #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
|
|
525
|
+
|
|
526
|
+ #ifdef Z_DUAL_ENDSTOPS
|
|
527
|
+
|
|
528
|
+ bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING,
|
|
529
|
+ z2_min_endstop =
|
|
530
|
+ #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0
|
|
531
|
+ READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING
|
|
532
|
+ #else
|
|
533
|
+ z_min_endstop
|
|
534
|
+ #endif
|
|
535
|
+ ;
|
|
536
|
+
|
|
537
|
+ bool z_min_both = z_min_endstop && old_z_min_endstop,
|
|
538
|
+ z2_min_both = z2_min_endstop && old_z2_min_endstop;
|
|
539
|
+ if ((z_min_both || z2_min_both) && current_block->steps[Z_AXIS] > 0) {
|
534
|
540
|
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
|
535
|
|
- endstop_z_hit=true;
|
536
|
|
- if (!(performing_homing) || ((performing_homing)&&(z_min_endstop && old_z_min_endstop)&&(z2_min_endstop && old_z2_min_endstop))) //if not performing home or if both endstops were trigged during homing...
|
537
|
|
- {
|
|
541
|
+ endstop_z_hit = true;
|
|
542
|
+ if (!performing_homing || (performing_homing && z_min_both && z2_min_both)) //if not performing home or if both endstops were trigged during homing...
|
538
|
543
|
step_events_completed = current_block->step_event_count;
|
539
|
|
- }
|
540
|
544
|
}
|
541
|
545
|
old_z_min_endstop = z_min_endstop;
|
542
|
546
|
old_z2_min_endstop = z2_min_endstop;
|
|
547
|
+<<<<<<< HEAD
|
543
|
548
|
#endif
|
544
|
549
|
#endif
|
545
|
550
|
|
|
@@ -556,37 +561,55 @@ ISR(TIMER1_COMPA_vect) {
|
556
|
561
|
old_z_probe_endstop = z_probe_endstop;
|
557
|
562
|
#endif
|
558
|
563
|
}
|
|
564
|
+=======
|
|
565
|
+
|
|
566
|
+ #else // !Z_DUAL_ENDSTOPS
|
|
567
|
+
|
|
568
|
+ UPDATE_ENDSTOP(z, Z, min, MIN);
|
|
569
|
+
|
|
570
|
+ #endif // !Z_DUAL_ENDSTOPS
|
|
571
|
+
|
|
572
|
+ #endif // Z_MIN_PIN
|
|
573
|
+
|
|
574
|
+ } // check_endstops
|
|
575
|
+
|
|
576
|
+>>>>>>> MarlinFirmware/Development
|
559
|
577
|
}
|
560
|
578
|
else { // +direction
|
|
579
|
+
|
561
|
580
|
Z_APPLY_DIR(!INVERT_Z_DIR,0);
|
562
|
581
|
count_direction[Z_AXIS] = 1;
|
|
582
|
+
|
563
|
583
|
if (check_endstops) {
|
|
584
|
+
|
564
|
585
|
#if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
|
565
|
|
- #ifndef Z_DUAL_ENDSTOPS
|
566
|
|
- UPDATE_ENDSTOP(z, Z, max, MAX);
|
567
|
|
- #else
|
568
|
|
- bool z_max_endstop=(READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING);
|
569
|
|
- #if defined(Z2_MAX_PIN) && Z2_MAX_PIN > -1
|
570
|
|
- bool z2_max_endstop=(READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING);
|
571
|
|
- #else
|
572
|
|
- bool z2_max_endstop=z_max_endstop;
|
573
|
|
- #endif
|
574
|
|
- if(((z_max_endstop && old_z_max_endstop) || (z2_max_endstop && old_z2_max_endstop)) && (current_block->steps[Z_AXIS] > 0))
|
575
|
|
- {
|
|
586
|
+
|
|
587
|
+ #ifdef Z_DUAL_ENDSTOPS
|
|
588
|
+
|
|
589
|
+ bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING,
|
|
590
|
+ z2_max_endstop =
|
|
591
|
+ #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
|
|
592
|
+ READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING
|
|
593
|
+ #else
|
|
594
|
+ z_max_endstop
|
|
595
|
+ #endif
|
|
596
|
+ ;
|
|
597
|
+
|
|
598
|
+ bool z_max_both = z_max_endstop && old_z_max_endstop,
|
|
599
|
+ z2_max_both = z2_max_endstop && old_z2_max_endstop;
|
|
600
|
+ if ((z_max_both || z2_max_both) && current_block->steps[Z_AXIS] > 0) {
|
576
|
601
|
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
|
577
|
|
- endstop_z_hit=true;
|
|
602
|
+ endstop_z_hit = true;
|
578
|
603
|
|
579
|
|
-// if (z_max_endstop && old_z_max_endstop) SERIAL_ECHOLN("z_max_endstop = true");
|
580
|
|
-// if (z2_max_endstop && old_z2_max_endstop) SERIAL_ECHOLN("z2_max_endstop = true");
|
|
604
|
+ // if (z_max_both) SERIAL_ECHOLN("z_max_endstop = true");
|
|
605
|
+ // if (z2_max_both) SERIAL_ECHOLN("z2_max_endstop = true");
|
581
|
606
|
|
582
|
|
-
|
583
|
|
- if (!(performing_homing) || ((performing_homing)&&(z_max_endstop && old_z_max_endstop)&&(z2_max_endstop && old_z2_max_endstop))) //if not performing home or if both endstops were trigged during homing...
|
584
|
|
- {
|
|
607
|
+ if (!performing_homing || (performing_homing && z_max_both && z2_max_both)) //if not performing home or if both endstops were trigged during homing...
|
585
|
608
|
step_events_completed = current_block->step_event_count;
|
586
|
|
- }
|
587
|
609
|
}
|
588
|
610
|
old_z_max_endstop = z_max_endstop;
|
589
|
611
|
old_z2_max_endstop = z2_max_endstop;
|
|
612
|
+<<<<<<< HEAD
|
590
|
613
|
#endif
|
591
|
614
|
#endif
|
592
|
615
|
|
|
@@ -603,20 +626,34 @@ ISR(TIMER1_COMPA_vect) {
|
603
|
626
|
#endif
|
604
|
627
|
}
|
605
|
628
|
}
|
|
629
|
+=======
|
|
630
|
+
|
|
631
|
+ #else // !Z_DUAL_ENDSTOPS
|
|
632
|
+
|
|
633
|
+ UPDATE_ENDSTOP(z, Z, max, MAX);
|
|
634
|
+
|
|
635
|
+ #endif // !Z_DUAL_ENDSTOPS
|
|
636
|
+
|
|
637
|
+ #endif // Z_MAX_PIN
|
|
638
|
+
|
|
639
|
+ } // check_endstops
|
|
640
|
+
|
|
641
|
+ } // +direction
|
|
642
|
+>>>>>>> MarlinFirmware/Development
|
606
|
643
|
|
607
|
644
|
#ifndef ADVANCE
|
608
|
645
|
if (TEST(out_bits, E_AXIS)) { // -direction
|
609
|
646
|
REV_E_DIR();
|
610
|
|
- count_direction[E_AXIS]=-1;
|
|
647
|
+ count_direction[E_AXIS] = -1;
|
611
|
648
|
}
|
612
|
649
|
else { // +direction
|
613
|
650
|
NORM_E_DIR();
|
614
|
|
- count_direction[E_AXIS]=1;
|
|
651
|
+ count_direction[E_AXIS] = 1;
|
615
|
652
|
}
|
616
|
653
|
#endif //!ADVANCE
|
617
|
654
|
|
618
|
655
|
// Take multiple steps per interrupt (For high speed moves)
|
619
|
|
- for (int8_t i=0; i < step_loops; i++) {
|
|
656
|
+ for (int8_t i = 0; i < step_loops; i++) {
|
620
|
657
|
#ifndef AT90USB
|
621
|
658
|
MSerial.checkRx(); // Check for serial chars.
|
622
|
659
|
#endif
|