|
@@ -613,3 +613,126 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
|
613
|
613
|
#define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR)
|
614
|
614
|
#define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR)
|
615
|
615
|
#endif
|
|
616
|
+
|
|
617
|
+//
|
|
618
|
+// Stepper enable / disable
|
|
619
|
+//
|
|
620
|
+#if HAS_X2_ENABLE
|
|
621
|
+ #define enable_X() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0)
|
|
622
|
+ #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0)
|
|
623
|
+#elif HAS_X_ENABLE
|
|
624
|
+ #define enable_X() X_ENABLE_WRITE( X_ENABLE_ON)
|
|
625
|
+ #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0)
|
|
626
|
+#else
|
|
627
|
+ #define enable_X() NOOP
|
|
628
|
+ #define disable_X() NOOP
|
|
629
|
+#endif
|
|
630
|
+
|
|
631
|
+#if HAS_Y2_ENABLE
|
|
632
|
+ #define enable_Y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0)
|
|
633
|
+ #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0)
|
|
634
|
+#elif HAS_Y_ENABLE
|
|
635
|
+ #define enable_Y() Y_ENABLE_WRITE( Y_ENABLE_ON)
|
|
636
|
+ #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0)
|
|
637
|
+#else
|
|
638
|
+ #define enable_Y() NOOP
|
|
639
|
+ #define disable_Y() NOOP
|
|
640
|
+#endif
|
|
641
|
+
|
|
642
|
+#if HAS_Z3_ENABLE
|
|
643
|
+ #define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); Z3_ENABLE_WRITE(Z_ENABLE_ON); }while(0)
|
|
644
|
+ #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); Z3_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0)
|
|
645
|
+#elif HAS_Z2_ENABLE
|
|
646
|
+ #define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0)
|
|
647
|
+ #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0)
|
|
648
|
+#elif HAS_Z_ENABLE
|
|
649
|
+ #define enable_Z() Z_ENABLE_WRITE( Z_ENABLE_ON)
|
|
650
|
+ #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0)
|
|
651
|
+#else
|
|
652
|
+ #define enable_Z() NOOP
|
|
653
|
+ #define disable_Z() NOOP
|
|
654
|
+#endif
|
|
655
|
+
|
|
656
|
+#if ENABLED(MIXING_EXTRUDER)
|
|
657
|
+
|
|
658
|
+ /**
|
|
659
|
+ * Mixing steppers synchronize their enable (and direction) together
|
|
660
|
+ */
|
|
661
|
+ #if MIXING_STEPPERS > 5
|
|
662
|
+ #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); E4_ENABLE_WRITE( E_ENABLE_ON); E5_ENABLE_WRITE( E_ENABLE_ON); }
|
|
663
|
+ #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); E4_ENABLE_WRITE(!E_ENABLE_ON); E5_ENABLE_WRITE(!E_ENABLE_ON); }
|
|
664
|
+ #elif MIXING_STEPPERS > 4
|
|
665
|
+ #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); E4_ENABLE_WRITE( E_ENABLE_ON); }
|
|
666
|
+ #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); E4_ENABLE_WRITE(!E_ENABLE_ON); }
|
|
667
|
+ #elif MIXING_STEPPERS > 3
|
|
668
|
+ #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); }
|
|
669
|
+ #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); }
|
|
670
|
+ #elif MIXING_STEPPERS > 2
|
|
671
|
+ #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); }
|
|
672
|
+ #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); }
|
|
673
|
+ #else
|
|
674
|
+ #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); }
|
|
675
|
+ #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); }
|
|
676
|
+ #endif
|
|
677
|
+ #define enable_E1() NOOP
|
|
678
|
+ #define disable_E1() NOOP
|
|
679
|
+ #define enable_E2() NOOP
|
|
680
|
+ #define disable_E2() NOOP
|
|
681
|
+ #define enable_E3() NOOP
|
|
682
|
+ #define disable_E3() NOOP
|
|
683
|
+ #define enable_E4() NOOP
|
|
684
|
+ #define disable_E4() NOOP
|
|
685
|
+ #define enable_E5() NOOP
|
|
686
|
+ #define disable_E5() NOOP
|
|
687
|
+
|
|
688
|
+#else // !MIXING_EXTRUDER
|
|
689
|
+
|
|
690
|
+ #if HAS_E0_ENABLE
|
|
691
|
+ #define enable_E0() E0_ENABLE_WRITE( E_ENABLE_ON)
|
|
692
|
+ #define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
|
|
693
|
+ #else
|
|
694
|
+ #define enable_E0() NOOP
|
|
695
|
+ #define disable_E0() NOOP
|
|
696
|
+ #endif
|
|
697
|
+
|
|
698
|
+ #if E_STEPPERS > 1 && HAS_E1_ENABLE
|
|
699
|
+ #define enable_E1() E1_ENABLE_WRITE( E_ENABLE_ON)
|
|
700
|
+ #define disable_E1() E1_ENABLE_WRITE(!E_ENABLE_ON)
|
|
701
|
+ #else
|
|
702
|
+ #define enable_E1() NOOP
|
|
703
|
+ #define disable_E1() NOOP
|
|
704
|
+ #endif
|
|
705
|
+
|
|
706
|
+ #if E_STEPPERS > 2 && HAS_E2_ENABLE
|
|
707
|
+ #define enable_E2() E2_ENABLE_WRITE( E_ENABLE_ON)
|
|
708
|
+ #define disable_E2() E2_ENABLE_WRITE(!E_ENABLE_ON)
|
|
709
|
+ #else
|
|
710
|
+ #define enable_E2() NOOP
|
|
711
|
+ #define disable_E2() NOOP
|
|
712
|
+ #endif
|
|
713
|
+
|
|
714
|
+ #if E_STEPPERS > 3 && HAS_E3_ENABLE
|
|
715
|
+ #define enable_E3() E3_ENABLE_WRITE( E_ENABLE_ON)
|
|
716
|
+ #define disable_E3() E3_ENABLE_WRITE(!E_ENABLE_ON)
|
|
717
|
+ #else
|
|
718
|
+ #define enable_E3() NOOP
|
|
719
|
+ #define disable_E3() NOOP
|
|
720
|
+ #endif
|
|
721
|
+
|
|
722
|
+ #if E_STEPPERS > 4 && HAS_E4_ENABLE
|
|
723
|
+ #define enable_E4() E4_ENABLE_WRITE( E_ENABLE_ON)
|
|
724
|
+ #define disable_E4() E4_ENABLE_WRITE(!E_ENABLE_ON)
|
|
725
|
+ #else
|
|
726
|
+ #define enable_E4() NOOP
|
|
727
|
+ #define disable_E4() NOOP
|
|
728
|
+ #endif
|
|
729
|
+
|
|
730
|
+ #if E_STEPPERS > 5 && HAS_E5_ENABLE
|
|
731
|
+ #define enable_E5() E5_ENABLE_WRITE( E_ENABLE_ON)
|
|
732
|
+ #define disable_E5() E5_ENABLE_WRITE(!E_ENABLE_ON)
|
|
733
|
+ #else
|
|
734
|
+ #define enable_E5() NOOP
|
|
735
|
+ #define disable_E5() NOOP
|
|
736
|
+ #endif
|
|
737
|
+
|
|
738
|
+#endif // !MIXING_EXTRUDER
|