|
|
@ -613,3 +613,126 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset |
|
|
|
#define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) |
|
|
|
#define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) |
|
|
|
#endif |
|
|
|
|
|
|
|
//
|
|
|
|
// Stepper enable / disable
|
|
|
|
//
|
|
|
|
#if HAS_X2_ENABLE |
|
|
|
#define enable_X() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0) |
|
|
|
#define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) |
|
|
|
#elif HAS_X_ENABLE |
|
|
|
#define enable_X() X_ENABLE_WRITE( X_ENABLE_ON) |
|
|
|
#define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) |
|
|
|
#else |
|
|
|
#define enable_X() NOOP |
|
|
|
#define disable_X() NOOP |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_Y2_ENABLE |
|
|
|
#define enable_Y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0) |
|
|
|
#define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0) |
|
|
|
#elif HAS_Y_ENABLE |
|
|
|
#define enable_Y() Y_ENABLE_WRITE( Y_ENABLE_ON) |
|
|
|
#define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0) |
|
|
|
#else |
|
|
|
#define enable_Y() NOOP |
|
|
|
#define disable_Y() NOOP |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_Z3_ENABLE |
|
|
|
#define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); Z3_ENABLE_WRITE(Z_ENABLE_ON); }while(0) |
|
|
|
#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) |
|
|
|
#elif HAS_Z2_ENABLE |
|
|
|
#define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0) |
|
|
|
#define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) |
|
|
|
#elif HAS_Z_ENABLE |
|
|
|
#define enable_Z() Z_ENABLE_WRITE( Z_ENABLE_ON) |
|
|
|
#define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) |
|
|
|
#else |
|
|
|
#define enable_Z() NOOP |
|
|
|
#define disable_Z() NOOP |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(MIXING_EXTRUDER) |
|
|
|
|
|
|
|
/**
|
|
|
|
* Mixing steppers synchronize their enable (and direction) together |
|
|
|
*/ |
|
|
|
#if MIXING_STEPPERS > 5 |
|
|
|
#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); } |
|
|
|
#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); } |
|
|
|
#elif MIXING_STEPPERS > 4 |
|
|
|
#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); } |
|
|
|
#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); } |
|
|
|
#elif MIXING_STEPPERS > 3 |
|
|
|
#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); } |
|
|
|
#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); } |
|
|
|
#elif MIXING_STEPPERS > 2 |
|
|
|
#define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); } |
|
|
|
#define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); } |
|
|
|
#else |
|
|
|
#define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); } |
|
|
|
#define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); } |
|
|
|
#endif |
|
|
|
#define enable_E1() NOOP |
|
|
|
#define disable_E1() NOOP |
|
|
|
#define enable_E2() NOOP |
|
|
|
#define disable_E2() NOOP |
|
|
|
#define enable_E3() NOOP |
|
|
|
#define disable_E3() NOOP |
|
|
|
#define enable_E4() NOOP |
|
|
|
#define disable_E4() NOOP |
|
|
|
#define enable_E5() NOOP |
|
|
|
#define disable_E5() NOOP |
|
|
|
|
|
|
|
#else // !MIXING_EXTRUDER
|
|
|
|
|
|
|
|
#if HAS_E0_ENABLE |
|
|
|
#define enable_E0() E0_ENABLE_WRITE( E_ENABLE_ON) |
|
|
|
#define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON) |
|
|
|
#else |
|
|
|
#define enable_E0() NOOP |
|
|
|
#define disable_E0() NOOP |
|
|
|
#endif |
|
|
|
|
|
|
|
#if E_STEPPERS > 1 && HAS_E1_ENABLE |
|
|
|
#define enable_E1() E1_ENABLE_WRITE( E_ENABLE_ON) |
|
|
|
#define disable_E1() E1_ENABLE_WRITE(!E_ENABLE_ON) |
|
|
|
#else |
|
|
|
#define enable_E1() NOOP |
|
|
|
#define disable_E1() NOOP |
|
|
|
#endif |
|
|
|
|
|
|
|
#if E_STEPPERS > 2 && HAS_E2_ENABLE |
|
|
|
#define enable_E2() E2_ENABLE_WRITE( E_ENABLE_ON) |
|
|
|
#define disable_E2() E2_ENABLE_WRITE(!E_ENABLE_ON) |
|
|
|
#else |
|
|
|
#define enable_E2() NOOP |
|
|
|
#define disable_E2() NOOP |
|
|
|
#endif |
|
|
|
|
|
|
|
#if E_STEPPERS > 3 && HAS_E3_ENABLE |
|
|
|
#define enable_E3() E3_ENABLE_WRITE( E_ENABLE_ON) |
|
|
|
#define disable_E3() E3_ENABLE_WRITE(!E_ENABLE_ON) |
|
|
|
#else |
|
|
|
#define enable_E3() NOOP |
|
|
|
#define disable_E3() NOOP |
|
|
|
#endif |
|
|
|
|
|
|
|
#if E_STEPPERS > 4 && HAS_E4_ENABLE |
|
|
|
#define enable_E4() E4_ENABLE_WRITE( E_ENABLE_ON) |
|
|
|
#define disable_E4() E4_ENABLE_WRITE(!E_ENABLE_ON) |
|
|
|
#else |
|
|
|
#define enable_E4() NOOP |
|
|
|
#define disable_E4() NOOP |
|
|
|
#endif |
|
|
|
|
|
|
|
#if E_STEPPERS > 5 && HAS_E5_ENABLE |
|
|
|
#define enable_E5() E5_ENABLE_WRITE( E_ENABLE_ON) |
|
|
|
#define disable_E5() E5_ENABLE_WRITE(!E_ENABLE_ON) |
|
|
|
#else |
|
|
|
#define enable_E5() NOOP |
|
|
|
#define disable_E5() NOOP |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // !MIXING_EXTRUDER
|
|
|
|