Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define Z3_DRIVER_TYPE A4988
//#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
Expand Down
23 changes: 23 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,17 @@
#endif
#endif

//#define Z_TRIPLE_STEPPER_DRIVERS
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
//#define Z_TRIPLE_ENDSTOPS
#if ENABLED(Z_TRIPLE_ENDSTOPS)
#define Z2_USE_ENDSTOP _XMAX_
#define Z3_USE_ENDSTOP _YMAX_
#define Z_TRIPLE2_ENDSTOPS_ADJUSTMENT 0
#define Z_TRIPLE3_ENDSTOPS_ADJUSTMENT 0
#endif
#endif

/**
* Dual X Carriage
*
Expand Down Expand Up @@ -1087,6 +1098,10 @@
#define Z2_SENSE_RESISTOR 91
#define Z2_MICROSTEPS 16

#define Z3_MAX_CURRENT 1000
#define Z3_SENSE_RESISTOR 91
#define Z3_MICROSTEPS 16

#define E0_MAX_CURRENT 1000
#define E0_SENSE_RESISTOR 91
#define E0_MICROSTEPS 16
Expand Down Expand Up @@ -1153,6 +1168,9 @@
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16

#define Z3_CURRENT 800
#define Z3_MICROSTEPS 16

#define E0_CURRENT 800
#define E0_MICROSTEPS 16

Expand Down Expand Up @@ -1217,6 +1235,7 @@
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define Z3_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
Expand Down Expand Up @@ -1315,6 +1334,10 @@
#define Z2_OVERCURRENT 2000
#define Z2_STALLCURRENT 1500

#define Z3_MICROSTEPS 16
#define Z3_OVERCURRENT 2000
#define Z3_STALLCURRENT 1500

#define E0_MICROSTEPS 16
#define E0_OVERCURRENT 2000
#define E0_STALLCURRENT 1500
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_AVR/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
|| defined(Y2_HARDWARE_SERIAL) \
|| defined(Z_HARDWARE_SERIAL ) \
|| defined(Z2_HARDWARE_SERIAL) \
|| defined(Z3_HARDWARE_SERIAL) \
|| defined(E0_HARDWARE_SERIAL) \
|| defined(E1_HARDWARE_SERIAL) \
|| defined(E2_HARDWARE_SERIAL) \
Expand Down
20 changes: 20 additions & 0 deletions Marlin/src/HAL/HAL_AVR/endstop_interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,26 @@ void setup_endstop_interrupts( void ) {
#endif
#endif

#if HAS_Z3_MAX
#if (digitalPinToInterrupt(Z3_MAX_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Z3_MAX_PIN) != NULL, "Z3_MAX_PIN is not interrupt-capable");
pciSetup(Z3_MAX_PIN);
#endif
#endif

#if HAS_Z3_MIN
#if (digitalPinToInterrupt(Z3_MIN_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Z3_MIN_PIN) != NULL, "Z3_MIN_PIN is not interrupt-capable");
pciSetup(Z3_MIN_PIN);
#endif
#endif

#if HAS_Z_MIN_PROBE_PIN
#if (digitalPinToInterrupt(Z_MIN_PROBE_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/HAL/HAL_DUE/endstop_interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ void setup_endstop_interrupts(void) {
#if HAS_Z2_MIN
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MAX
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MIN
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
#endif
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ void setup_endstop_interrupts(void) {
#if HAS_Z2_MIN
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MAX
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MIN
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
#endif
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ void setup_endstop_interrupts(void) {
#endif
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MAX
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MIN
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
#if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PROBE_PIN)
#error "Z_MIN_PROBE_PIN is not an INTERRUPT capable pin."
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ void setup_endstop_interrupts(void) {
#if HAS_Z2_MIN
attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MAX
attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MIN
attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
#endif
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/HAL/HAL_STM32F4/endstop_interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ void setup_endstop_interrupts(void) {
#if HAS_Z2_MIN
attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MAX
attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MIN
attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
#endif
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/HAL/HAL_STM32F7/endstop_interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ void setup_endstop_interrupts(void) {
#if HAS_Z2_MIN
attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MAX
attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MIN
attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
#endif
Expand Down
20 changes: 8 additions & 12 deletions Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,44 +43,40 @@
void endstop_ISR(void) { endstops.update(); }

/**
* Endstop interrupts for Due based targets.
* On Due, all pins support external interrupt capability.
* Endstop interrupts for Due based targets.
* On Due, all pins support external interrupt capability.
*/

void setup_endstop_interrupts( void ) {

#if HAS_X_MAX
attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it
#endif

#if HAS_X_MIN
attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
#endif

#if HAS_Y_MAX
attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
#endif

#if HAS_Y_MIN
attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
#endif

#if HAS_Z_MAX
attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
#endif

#if HAS_Z_MIN
attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
#endif

#if HAS_Z2_MAX
attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
#endif

#if HAS_Z2_MIN
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
#endif

#if HAS_Z3_MAX
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MIN
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
#endif
Expand Down
5 changes: 4 additions & 1 deletion Marlin/src/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
#define disable_Y() NOOP
#endif

#if HAS_Z2_ENABLE
#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
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/config/default/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define Z3_DRIVER_TYPE A4988
//#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
Expand Down
23 changes: 23 additions & 0 deletions Marlin/src/config/default/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,17 @@
#endif
#endif

//#define Z_TRIPLE_STEPPER_DRIVERS
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
//#define Z_TRIPLE_ENDSTOPS
#if ENABLED(Z_TRIPLE_ENDSTOPS)
#define Z2_USE_ENDSTOP _XMAX_
#define Z3_USE_ENDSTOP _YMAX_
#define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0
#define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0
#endif
#endif

/**
* Dual X Carriage
*
Expand Down Expand Up @@ -1087,6 +1098,10 @@
#define Z2_SENSE_RESISTOR 91
#define Z2_MICROSTEPS 16

#define Z3_MAX_CURRENT 1000
#define Z3_SENSE_RESISTOR 91
#define Z3_MICROSTEPS 16

#define E0_MAX_CURRENT 1000
#define E0_SENSE_RESISTOR 91
#define E0_MICROSTEPS 16
Expand Down Expand Up @@ -1153,6 +1168,9 @@
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16

#define Z3_CURRENT 800
#define Z3_MICROSTEPS 16

#define E0_CURRENT 800
#define E0_MICROSTEPS 16

Expand Down Expand Up @@ -1217,6 +1235,7 @@
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define Z3_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
Expand Down Expand Up @@ -1315,6 +1334,10 @@
#define Z2_OVERCURRENT 2000
#define Z2_STALLCURRENT 1500

#define Z3_MICROSTEPS 16
#define Z3_OVERCURRENT 2000
#define Z3_STALLCURRENT 1500

#define E0_MICROSTEPS 16
#define E0_OVERCURRENT 2000
#define E0_STALLCURRENT 1500
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define Z3_DRIVER_TYPE A4988
//#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
Expand Down
23 changes: 23 additions & 0 deletions Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,17 @@
#endif
#endif

//#define Z_TRIPLE_STEPPER_DRIVERS
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
//#define Z_TRIPLE_ENDSTOPS
#if ENABLED(Z_TRIPLE_ENDSTOPS)
#define Z2_USE_ENDSTOP _XMAX_
#define Z3_USE_ENDSTOP _YMAX_
#define Z_TRIPLE2_ENDSTOPS_ADJUSTMENT 0
#define Z_TRIPLE3_ENDSTOPS_ADJUSTMENT 0
#endif
#endif

/**
* Dual X Carriage
*
Expand Down Expand Up @@ -1087,6 +1098,10 @@
#define Z2_SENSE_RESISTOR 91
#define Z2_MICROSTEPS 16

#define Z3_MAX_CURRENT 1000
#define Z3_SENSE_RESISTOR 91
#define Z3_MICROSTEPS 16

#define E0_MAX_CURRENT 1000
#define E0_SENSE_RESISTOR 91
#define E0_MICROSTEPS 16
Expand Down Expand Up @@ -1153,6 +1168,9 @@
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16

#define Z3_CURRENT 800
#define Z3_MICROSTEPS 16

#define E0_CURRENT 800
#define E0_MICROSTEPS 16

Expand Down Expand Up @@ -1217,6 +1235,7 @@
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define Z3_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
Expand Down Expand Up @@ -1315,6 +1334,10 @@
#define Z2_OVERCURRENT 2000
#define Z2_STALLCURRENT 1500

#define Z3_MICROSTEPS 16
#define Z3_OVERCURRENT 2000
#define Z3_STALLCURRENT 1500

#define E0_MICROSTEPS 16
#define E0_OVERCURRENT 2000
#define E0_STALLCURRENT 1500
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define Z3_DRIVER_TYPE A4988
//#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/config/examples/Anet/A2/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define Z3_DRIVER_TYPE A4988
//#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
Expand Down
Loading