🔧 More endstops refactoring (#25758)

This commit is contained in:
Scott Lahteine 2023-08-01 23:03:06 -05:00 committed by GitHub
parent 5da7143fe5
commit bed26734a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 883 additions and 731 deletions

View file

@ -1751,6 +1751,21 @@
//#define V_HOME_DIR -1 //#define V_HOME_DIR -1
//#define W_HOME_DIR -1 //#define W_HOME_DIR -1
/**
* Safety Stops
* If an axis has endstops on both ends the one specified above is used for
* homing, while the other can be used for things like SD_ABORT_ON_ENDSTOP_HIT.
*/
//#define X_SAFETY_STOP
//#define Y_SAFETY_STOP
//#define Z_SAFETY_STOP
//#define I_SAFETY_STOP
//#define J_SAFETY_STOP
//#define K_SAFETY_STOP
//#define U_SAFETY_STOP
//#define V_SAFETY_STOP
//#define W_SAFETY_STOP
// @section geometry // @section geometry
// The size of the printable area // The size of the printable area

View file

@ -160,7 +160,7 @@ void setup_endstop_interrupts() {
pciSetup(Z_MAX_PIN); pciSetup(Z_MAX_PIN);
#endif #endif
#endif #endif
#if HAS_Z_MIN_PIN #if USE_Z_MIN
#if (digitalPinToInterrupt(Z_MIN_PIN) != NOT_AN_INTERRUPT) #if (digitalPinToInterrupt(Z_MIN_PIN) != NOT_AN_INTERRUPT)
_ATTACH(Z_MIN_PIN); _ATTACH(Z_MIN_PIN);
#else #else

View file

@ -52,7 +52,7 @@ void setup_endstop_interrupts() {
TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN)); TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN));
TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN)); TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN));
TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN)); TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN));
TERN_(HAS_Z_MIN_PIN, _ATTACH(Z_MIN_PIN)); TERN_(USE_Z_MIN, _ATTACH(Z_MIN_PIN));
TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN)); TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN));
TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN)); TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN));
TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN)); TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN));

View file

@ -47,7 +47,7 @@ void setup_endstop_interrupts() {
TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN)); TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN));
TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN)); TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN));
TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN)); TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN));
TERN_(HAS_Z_MIN_PIN, _ATTACH(Z_MIN_PIN)); TERN_(USE_Z_MIN, _ATTACH(Z_MIN_PIN));
TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN)); TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN));
TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN)); TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN));
TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN)); TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN));

View file

@ -74,7 +74,7 @@ void setup_endstop_interrupts() {
#endif #endif
_ATTACH(Z_MAX_PIN); _ATTACH(Z_MAX_PIN);
#endif #endif
#if HAS_Z_MIN_PIN #if USE_Z_MIN
#if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PIN) #if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PIN)
#error "Z_MIN_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #error "Z_MIN_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
#endif #endif

View file

@ -54,34 +54,34 @@
#include "../../module/endstops.h" #include "../../module/endstops.h"
#define MATCH_EILINE(P1,P2) (P1 != P2 && PIN_TO_EILINE(P1) == PIN_TO_EILINE(P2)) #define MATCH_EILINE(P1,P2) (P1 != P2 && PIN_TO_EILINE(P1) == PIN_TO_EILINE(P2))
#define MATCH_X_MAX_EILINE(P) TERN0(USE_X_MAX, DEFER4(MATCH_EILINE)(P, X_MAX_PIN)) #define MATCH_X_MAX_EILINE(P) TERN0(USE_X_MAX, DEFER4(MATCH_EILINE)(P, X_MAX_PIN))
#define MATCH_X_MIN_EILINE(P) TERN0(USE_X_MIN, DEFER4(MATCH_EILINE)(P, X_MIN_PIN)) #define MATCH_X_MIN_EILINE(P) TERN0(USE_X_MIN, DEFER4(MATCH_EILINE)(P, X_MIN_PIN))
#define MATCH_Y_MAX_EILINE(P) TERN0(USE_Y_MAX, DEFER4(MATCH_EILINE)(P, Y_MAX_PIN)) #define MATCH_Y_MAX_EILINE(P) TERN0(USE_Y_MAX, DEFER4(MATCH_EILINE)(P, Y_MAX_PIN))
#define MATCH_Y_MIN_EILINE(P) TERN0(USE_Y_MIN, DEFER4(MATCH_EILINE)(P, Y_MIN_PIN)) #define MATCH_Y_MIN_EILINE(P) TERN0(USE_Y_MIN, DEFER4(MATCH_EILINE)(P, Y_MIN_PIN))
#define MATCH_Z_MAX_EILINE(P) TERN0(USE_Z_MAX, DEFER4(MATCH_EILINE)(P, Z_MAX_PIN)) #define MATCH_Z_MAX_EILINE(P) TERN0(USE_Z_MAX, DEFER4(MATCH_EILINE)(P, Z_MAX_PIN))
#define MATCH_Z_MIN_EILINE(P) TERN0(HAS_Z_MIN_PIN, DEFER4(MATCH_EILINE)(P, Z_MIN_PIN)) #define MATCH_Z_MIN_EILINE(P) TERN0(USE_Z_MIN, DEFER4(MATCH_EILINE)(P, Z_MIN_PIN))
#define MATCH_I_MAX_EILINE(P) TERN0(USE_I_MAX, DEFER4(MATCH_EILINE)(P, I_MAX_PIN)) #define MATCH_I_MAX_EILINE(P) TERN0(USE_I_MAX, DEFER4(MATCH_EILINE)(P, I_MAX_PIN))
#define MATCH_I_MIN_EILINE(P) TERN0(USE_I_MIN, DEFER4(MATCH_EILINE)(P, I_MIN_PIN)) #define MATCH_I_MIN_EILINE(P) TERN0(USE_I_MIN, DEFER4(MATCH_EILINE)(P, I_MIN_PIN))
#define MATCH_J_MAX_EILINE(P) TERN0(USE_J_MAX, DEFER4(MATCH_EILINE)(P, J_MAX_PIN)) #define MATCH_J_MAX_EILINE(P) TERN0(USE_J_MAX, DEFER4(MATCH_EILINE)(P, J_MAX_PIN))
#define MATCH_J_MIN_EILINE(P) TERN0(USE_J_MIN, DEFER4(MATCH_EILINE)(P, J_MIN_PIN)) #define MATCH_J_MIN_EILINE(P) TERN0(USE_J_MIN, DEFER4(MATCH_EILINE)(P, J_MIN_PIN))
#define MATCH_K_MAX_EILINE(P) TERN0(USE_K_MAX, DEFER4(MATCH_EILINE)(P, K_MAX_PIN)) #define MATCH_K_MAX_EILINE(P) TERN0(USE_K_MAX, DEFER4(MATCH_EILINE)(P, K_MAX_PIN))
#define MATCH_K_MIN_EILINE(P) TERN0(USE_K_MIN, DEFER4(MATCH_EILINE)(P, K_MIN_PIN)) #define MATCH_K_MIN_EILINE(P) TERN0(USE_K_MIN, DEFER4(MATCH_EILINE)(P, K_MIN_PIN))
#define MATCH_U_MAX_EILINE(P) TERN0(USE_U_MAX, DEFER4(MATCH_EILINE)(P, U_MAX_PIN)) #define MATCH_U_MAX_EILINE(P) TERN0(USE_U_MAX, DEFER4(MATCH_EILINE)(P, U_MAX_PIN))
#define MATCH_U_MIN_EILINE(P) TERN0(USE_U_MIN, DEFER4(MATCH_EILINE)(P, U_MIN_PIN)) #define MATCH_U_MIN_EILINE(P) TERN0(USE_U_MIN, DEFER4(MATCH_EILINE)(P, U_MIN_PIN))
#define MATCH_V_MAX_EILINE(P) TERN0(USE_V_MAX, DEFER4(MATCH_EILINE)(P, V_MAX_PIN)) #define MATCH_V_MAX_EILINE(P) TERN0(USE_V_MAX, DEFER4(MATCH_EILINE)(P, V_MAX_PIN))
#define MATCH_V_MIN_EILINE(P) TERN0(USE_V_MIN, DEFER4(MATCH_EILINE)(P, V_MIN_PIN)) #define MATCH_V_MIN_EILINE(P) TERN0(USE_V_MIN, DEFER4(MATCH_EILINE)(P, V_MIN_PIN))
#define MATCH_W_MAX_EILINE(P) TERN0(USE_W_MAX, DEFER4(MATCH_EILINE)(P, W_MAX_PIN)) #define MATCH_W_MAX_EILINE(P) TERN0(USE_W_MAX, DEFER4(MATCH_EILINE)(P, W_MAX_PIN))
#define MATCH_W_MIN_EILINE(P) TERN0(USE_W_MIN, DEFER4(MATCH_EILINE)(P, W_MIN_PIN)) #define MATCH_W_MIN_EILINE(P) TERN0(USE_W_MIN, DEFER4(MATCH_EILINE)(P, W_MIN_PIN))
#define MATCH_X2_MAX_EILINE(P) TERN0(USE_X2_MAX, DEFER4(MATCH_EILINE)(P, X2_MAX_PIN)) #define MATCH_X2_MAX_EILINE(P) TERN0(USE_X2_MAX, DEFER4(MATCH_EILINE)(P, X2_MAX_PIN))
#define MATCH_X2_MIN_EILINE(P) TERN0(USE_X2_MIN, DEFER4(MATCH_EILINE)(P, X2_MIN_PIN)) #define MATCH_X2_MIN_EILINE(P) TERN0(USE_X2_MIN, DEFER4(MATCH_EILINE)(P, X2_MIN_PIN))
#define MATCH_Y2_MAX_EILINE(P) TERN0(USE_Y2_MAX, DEFER4(MATCH_EILINE)(P, Y2_MAX_PIN)) #define MATCH_Y2_MAX_EILINE(P) TERN0(USE_Y2_MAX, DEFER4(MATCH_EILINE)(P, Y2_MAX_PIN))
#define MATCH_Y2_MIN_EILINE(P) TERN0(USE_Y2_MIN, DEFER4(MATCH_EILINE)(P, Y2_MIN_PIN)) #define MATCH_Y2_MIN_EILINE(P) TERN0(USE_Y2_MIN, DEFER4(MATCH_EILINE)(P, Y2_MIN_PIN))
#define MATCH_Z2_MAX_EILINE(P) TERN0(USE_Z2_MAX, DEFER4(MATCH_EILINE)(P, Z2_MAX_PIN)) #define MATCH_Z2_MAX_EILINE(P) TERN0(USE_Z2_MAX, DEFER4(MATCH_EILINE)(P, Z2_MAX_PIN))
#define MATCH_Z2_MIN_EILINE(P) TERN0(USE_Z2_MIN, DEFER4(MATCH_EILINE)(P, Z2_MIN_PIN)) #define MATCH_Z2_MIN_EILINE(P) TERN0(USE_Z2_MIN, DEFER4(MATCH_EILINE)(P, Z2_MIN_PIN))
#define MATCH_Z3_MAX_EILINE(P) TERN0(USE_Z3_MAX, DEFER4(MATCH_EILINE)(P, Z3_MAX_PIN)) #define MATCH_Z3_MAX_EILINE(P) TERN0(USE_Z3_MAX, DEFER4(MATCH_EILINE)(P, Z3_MAX_PIN))
#define MATCH_Z3_MIN_EILINE(P) TERN0(USE_Z3_MIN, DEFER4(MATCH_EILINE)(P, Z3_MIN_PIN)) #define MATCH_Z3_MIN_EILINE(P) TERN0(USE_Z3_MIN, DEFER4(MATCH_EILINE)(P, Z3_MIN_PIN))
#define MATCH_Z4_MAX_EILINE(P) TERN0(USE_Z4_MAX, DEFER4(MATCH_EILINE)(P, Z4_MAX_PIN)) #define MATCH_Z4_MAX_EILINE(P) TERN0(USE_Z4_MAX, DEFER4(MATCH_EILINE)(P, Z4_MAX_PIN))
#define MATCH_Z4_MIN_EILINE(P) TERN0(USE_Z4_MIN, DEFER4(MATCH_EILINE)(P, Z4_MIN_PIN)) #define MATCH_Z4_MIN_EILINE(P) TERN0(USE_Z4_MIN, DEFER4(MATCH_EILINE)(P, Z4_MIN_PIN))
#define MATCH_Z_MIN_PROBE_EILINE(P) TERN0(USE_Z_MIN_PROBE, DEFER4(MATCH_EILINE)(P, Z_MIN_PROBE_PIN)) #define MATCH_Z_MIN_PROBE_EILINE(P) TERN0(USE_Z_MIN_PROBE, DEFER4(MATCH_EILINE)(P, Z_MIN_PROBE_PIN))
#define AVAILABLE_EILINE(P) ( PIN_TO_EILINE(P) != -1 \ #define AVAILABLE_EILINE(P) ( PIN_TO_EILINE(P) != -1 \
@ -136,7 +136,7 @@ void setup_endstop_interrupts() {
#endif #endif
_ATTACH(Z_MAX_PIN); _ATTACH(Z_MAX_PIN);
#endif #endif
#if HAS_Z_MIN_PIN #if USE_Z_MIN
#if !AVAILABLE_EILINE(Z_MIN_PIN) #if !AVAILABLE_EILINE(Z_MIN_PIN)
#error "Z_MIN_PIN has no EXTINT line available. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #error "Z_MIN_PIN has no EXTINT line available. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
#endif #endif

View file

@ -53,34 +53,34 @@
#include "../../module/endstops.h" #include "../../module/endstops.h"
#define MATCH_EILINE(P1,P2) (P1 != P2 && PIN_TO_EILINE(P1) == PIN_TO_EILINE(P2)) #define MATCH_EILINE(P1,P2) (P1 != P2 && PIN_TO_EILINE(P1) == PIN_TO_EILINE(P2))
#define MATCH_X_MAX_EILINE(P) TERN0(USE_X_MAX, DEFER4(MATCH_EILINE)(P, X_MAX_PIN)) #define MATCH_X_MAX_EILINE(P) TERN0(USE_X_MAX, DEFER4(MATCH_EILINE)(P, X_MAX_PIN))
#define MATCH_X_MIN_EILINE(P) TERN0(USE_X_MIN, DEFER4(MATCH_EILINE)(P, X_MIN_PIN)) #define MATCH_X_MIN_EILINE(P) TERN0(USE_X_MIN, DEFER4(MATCH_EILINE)(P, X_MIN_PIN))
#define MATCH_Y_MAX_EILINE(P) TERN0(USE_Y_MAX, DEFER4(MATCH_EILINE)(P, Y_MAX_PIN)) #define MATCH_Y_MAX_EILINE(P) TERN0(USE_Y_MAX, DEFER4(MATCH_EILINE)(P, Y_MAX_PIN))
#define MATCH_Y_MIN_EILINE(P) TERN0(USE_Y_MIN, DEFER4(MATCH_EILINE)(P, Y_MIN_PIN)) #define MATCH_Y_MIN_EILINE(P) TERN0(USE_Y_MIN, DEFER4(MATCH_EILINE)(P, Y_MIN_PIN))
#define MATCH_Z_MAX_EILINE(P) TERN0(USE_Z_MAX, DEFER4(MATCH_EILINE)(P, Z_MAX_PIN)) #define MATCH_Z_MAX_EILINE(P) TERN0(USE_Z_MAX, DEFER4(MATCH_EILINE)(P, Z_MAX_PIN))
#define MATCH_Z_MIN_EILINE(P) TERN0(HAS_Z_MIN_PIN, DEFER4(MATCH_EILINE)(P, Z_MIN_PIN)) #define MATCH_Z_MIN_EILINE(P) TERN0(USE_Z_MIN, DEFER4(MATCH_EILINE)(P, Z_MIN_PIN))
#define MATCH_I_MAX_EILINE(P) TERN0(USE_I_MAX, DEFER4(MATCH_EILINE)(P, I_MAX_PIN)) #define MATCH_I_MAX_EILINE(P) TERN0(USE_I_MAX, DEFER4(MATCH_EILINE)(P, I_MAX_PIN))
#define MATCH_I_MIN_EILINE(P) TERN0(USE_I_MIN, DEFER4(MATCH_EILINE)(P, I_MIN_PIN)) #define MATCH_I_MIN_EILINE(P) TERN0(USE_I_MIN, DEFER4(MATCH_EILINE)(P, I_MIN_PIN))
#define MATCH_J_MAX_EILINE(P) TERN0(USE_J_MAX, DEFER4(MATCH_EILINE)(P, J_MAX_PIN)) #define MATCH_J_MAX_EILINE(P) TERN0(USE_J_MAX, DEFER4(MATCH_EILINE)(P, J_MAX_PIN))
#define MATCH_J_MIN_EILINE(P) TERN0(USE_J_MIN, DEFER4(MATCH_EILINE)(P, J_MIN_PIN)) #define MATCH_J_MIN_EILINE(P) TERN0(USE_J_MIN, DEFER4(MATCH_EILINE)(P, J_MIN_PIN))
#define MATCH_K_MAX_EILINE(P) TERN0(USE_K_MAX, DEFER4(MATCH_EILINE)(P, K_MAX_PIN)) #define MATCH_K_MAX_EILINE(P) TERN0(USE_K_MAX, DEFER4(MATCH_EILINE)(P, K_MAX_PIN))
#define MATCH_K_MIN_EILINE(P) TERN0(USE_K_MIN, DEFER4(MATCH_EILINE)(P, K_MIN_PIN)) #define MATCH_K_MIN_EILINE(P) TERN0(USE_K_MIN, DEFER4(MATCH_EILINE)(P, K_MIN_PIN))
#define MATCH_U_MAX_EILINE(P) TERN0(USE_U_MAX, DEFER4(MATCH_EILINE)(P, U_MAX_PIN)) #define MATCH_U_MAX_EILINE(P) TERN0(USE_U_MAX, DEFER4(MATCH_EILINE)(P, U_MAX_PIN))
#define MATCH_U_MIN_EILINE(P) TERN0(USE_U_MIN, DEFER4(MATCH_EILINE)(P, U_MIN_PIN)) #define MATCH_U_MIN_EILINE(P) TERN0(USE_U_MIN, DEFER4(MATCH_EILINE)(P, U_MIN_PIN))
#define MATCH_V_MAX_EILINE(P) TERN0(USE_V_MAX, DEFER4(MATCH_EILINE)(P, V_MAX_PIN)) #define MATCH_V_MAX_EILINE(P) TERN0(USE_V_MAX, DEFER4(MATCH_EILINE)(P, V_MAX_PIN))
#define MATCH_V_MIN_EILINE(P) TERN0(USE_V_MIN, DEFER4(MATCH_EILINE)(P, V_MIN_PIN)) #define MATCH_V_MIN_EILINE(P) TERN0(USE_V_MIN, DEFER4(MATCH_EILINE)(P, V_MIN_PIN))
#define MATCH_W_MAX_EILINE(P) TERN0(USE_W_MAX, DEFER4(MATCH_EILINE)(P, W_MAX_PIN)) #define MATCH_W_MAX_EILINE(P) TERN0(USE_W_MAX, DEFER4(MATCH_EILINE)(P, W_MAX_PIN))
#define MATCH_W_MIN_EILINE(P) TERN0(USE_W_MIN, DEFER4(MATCH_EILINE)(P, W_MIN_PIN)) #define MATCH_W_MIN_EILINE(P) TERN0(USE_W_MIN, DEFER4(MATCH_EILINE)(P, W_MIN_PIN))
#define MATCH_X2_MAX_EILINE(P) TERN0(USE_X2_MAX, DEFER4(MATCH_EILINE)(P, X2_MAX_PIN)) #define MATCH_X2_MAX_EILINE(P) TERN0(USE_X2_MAX, DEFER4(MATCH_EILINE)(P, X2_MAX_PIN))
#define MATCH_X2_MIN_EILINE(P) TERN0(USE_X2_MIN, DEFER4(MATCH_EILINE)(P, X2_MIN_PIN)) #define MATCH_X2_MIN_EILINE(P) TERN0(USE_X2_MIN, DEFER4(MATCH_EILINE)(P, X2_MIN_PIN))
#define MATCH_Y2_MAX_EILINE(P) TERN0(USE_Y2_MAX, DEFER4(MATCH_EILINE)(P, Y2_MAX_PIN)) #define MATCH_Y2_MAX_EILINE(P) TERN0(USE_Y2_MAX, DEFER4(MATCH_EILINE)(P, Y2_MAX_PIN))
#define MATCH_Y2_MIN_EILINE(P) TERN0(USE_Y2_MIN, DEFER4(MATCH_EILINE)(P, Y2_MIN_PIN)) #define MATCH_Y2_MIN_EILINE(P) TERN0(USE_Y2_MIN, DEFER4(MATCH_EILINE)(P, Y2_MIN_PIN))
#define MATCH_Z2_MAX_EILINE(P) TERN0(USE_Z2_MAX, DEFER4(MATCH_EILINE)(P, Z2_MAX_PIN)) #define MATCH_Z2_MAX_EILINE(P) TERN0(USE_Z2_MAX, DEFER4(MATCH_EILINE)(P, Z2_MAX_PIN))
#define MATCH_Z2_MIN_EILINE(P) TERN0(USE_Z2_MIN, DEFER4(MATCH_EILINE)(P, Z2_MIN_PIN)) #define MATCH_Z2_MIN_EILINE(P) TERN0(USE_Z2_MIN, DEFER4(MATCH_EILINE)(P, Z2_MIN_PIN))
#define MATCH_Z3_MAX_EILINE(P) TERN0(USE_Z3_MAX, DEFER4(MATCH_EILINE)(P, Z3_MAX_PIN)) #define MATCH_Z3_MAX_EILINE(P) TERN0(USE_Z3_MAX, DEFER4(MATCH_EILINE)(P, Z3_MAX_PIN))
#define MATCH_Z3_MIN_EILINE(P) TERN0(USE_Z3_MIN, DEFER4(MATCH_EILINE)(P, Z3_MIN_PIN)) #define MATCH_Z3_MIN_EILINE(P) TERN0(USE_Z3_MIN, DEFER4(MATCH_EILINE)(P, Z3_MIN_PIN))
#define MATCH_Z4_MAX_EILINE(P) TERN0(USE_Z4_MAX, DEFER4(MATCH_EILINE)(P, Z4_MAX_PIN)) #define MATCH_Z4_MAX_EILINE(P) TERN0(USE_Z4_MAX, DEFER4(MATCH_EILINE)(P, Z4_MAX_PIN))
#define MATCH_Z4_MIN_EILINE(P) TERN0(USE_Z4_MIN, DEFER4(MATCH_EILINE)(P, Z4_MIN_PIN)) #define MATCH_Z4_MIN_EILINE(P) TERN0(USE_Z4_MIN, DEFER4(MATCH_EILINE)(P, Z4_MIN_PIN))
#define MATCH_Z_MIN_PROBE_EILINE(P) TERN0(USE_Z_MIN_PROBE, DEFER4(MATCH_EILINE)(P, Z_MIN_PROBE_PIN)) #define MATCH_Z_MIN_PROBE_EILINE(P) TERN0(USE_Z_MIN_PROBE, DEFER4(MATCH_EILINE)(P, Z_MIN_PROBE_PIN))
#define AVAILABLE_EILINE(P) ( PIN_TO_EILINE(P) != -1 \ #define AVAILABLE_EILINE(P) ( PIN_TO_EILINE(P) != -1 \
@ -135,7 +135,7 @@ void setup_endstop_interrupts() {
#endif #endif
_ATTACH(Z_MAX_PIN); _ATTACH(Z_MAX_PIN);
#endif #endif
#if HAS_Z_MIN_PIN #if USE_Z_MIN
#if !AVAILABLE_EILINE(Z_MIN_PIN) #if !AVAILABLE_EILINE(Z_MIN_PIN)
#error "Z_MIN_PIN has no EXTINT line available. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #error "Z_MIN_PIN has no EXTINT line available. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
#endif #endif

View file

@ -34,7 +34,7 @@ void setup_endstop_interrupts() {
TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN)); TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN));
TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN)); TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN));
TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN)); TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN));
TERN_(HAS_Z_MIN_PIN, _ATTACH(Z_MIN_PIN)); TERN_(USE_Z_MIN, _ATTACH(Z_MIN_PIN));
TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN)); TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN));
TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN)); TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN));
TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN)); TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN));

View file

@ -59,7 +59,7 @@ void setup_endstop_interrupts() {
TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN)); TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN));
TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN)); TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN));
TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN)); TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN));
TERN_(HAS_Z_MIN_PIN, _ATTACH(Z_MIN_PIN)); TERN_(USE_Z_MIN, _ATTACH(Z_MIN_PIN));
TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN)); TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN));
TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN)); TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN));
TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN)); TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN));

View file

@ -52,7 +52,7 @@ void setup_endstop_interrupts() {
TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN)); TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN));
TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN)); TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN));
TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN)); TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN));
TERN_(HAS_Z_MIN_PIN, _ATTACH(Z_MIN_PIN)); TERN_(USE_Z_MIN, _ATTACH(Z_MIN_PIN));
TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN)); TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN));
TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN)); TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN));
TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN)); TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN));

View file

@ -51,7 +51,7 @@ void setup_endstop_interrupts() {
TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN)); TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN));
TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN)); TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN));
TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN)); TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN));
TERN_(HAS_Z_MIN_PIN, _ATTACH(Z_MIN_PIN)); TERN_(USE_Z_MIN, _ATTACH(Z_MIN_PIN));
TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN)); TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN));
TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN)); TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN));
TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN)); TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN));

View file

@ -51,7 +51,7 @@ void setup_endstop_interrupts() {
TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN)); TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN));
TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN)); TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN));
TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN)); TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN));
TERN_(HAS_Z_MIN_PIN, _ATTACH(Z_MIN_PIN)); TERN_(USE_Z_MIN, _ATTACH(Z_MIN_PIN));
TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN)); TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN));
TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN)); TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN));
TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN)); TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN));

View file

@ -254,69 +254,67 @@ void GcodeSuite::G28() {
// Reset to the XY plane // Reset to the XY plane
TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY); TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY);
#define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT) #define _OR_HAS_CURR_HOME(N) HAS_CURRENT_HOME(N) ||
#if HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2) || (ENABLED(DELTA) && HAS_CURRENT_HOME(Z)) || HAS_CURRENT_HOME(I) || HAS_CURRENT_HOME(J) || HAS_CURRENT_HOME(K) || HAS_CURRENT_HOME(U) || HAS_CURRENT_HOME(V) || HAS_CURRENT_HOME(W) #if MAIN_AXIS_MAP(_OR_HAS_CURR_HOME) MAP(_OR_HAS_CURR_HOME, X2, Y2, Z2, Z3, Z4) 0
#define HAS_HOMING_CURRENT 1 #define HAS_HOMING_CURRENT 1
#endif #endif
#if HAS_HOMING_CURRENT #if HAS_HOMING_CURRENT
auto debug_current = [](FSTR_P const s, const int16_t a, const int16_t b) {
DEBUG_ECHOLN(s, F(" current: "), a, F(" -> "), b); #if ENABLED(DEBUG_LEVELING_FEATURE)
}; auto debug_current = [](FSTR_P const s, const int16_t a, const int16_t b) {
if (DEBUGGING(LEVELING)) { DEBUG_ECHOF(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); }
};
#else
#define debug_current(...)
#endif
#define _SAVE_SET_CURRENT(A) \
const int16_t saved_current_##A = stepper##A.getMilliamps(); \
stepper##A.rms_current(A##_CURRENT_HOME); \
debug_current(F(STR_##A), saved_current_##A, A##_CURRENT_HOME)
#if HAS_CURRENT_HOME(X) #if HAS_CURRENT_HOME(X)
const int16_t tmc_save_current_X = stepperX.getMilliamps(); _SAVE_SET_CURRENT(X);
stepperX.rms_current(X_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_X), tmc_save_current_X, X_CURRENT_HOME);
#endif #endif
#if HAS_CURRENT_HOME(X2) #if HAS_CURRENT_HOME(X2)
const int16_t tmc_save_current_X2 = stepperX2.getMilliamps(); _SAVE_SET_CURRENT(X2);
stepperX2.rms_current(X2_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_X2), tmc_save_current_X2, X2_CURRENT_HOME);
#endif #endif
#if HAS_CURRENT_HOME(Y) #if HAS_CURRENT_HOME(Y)
const int16_t tmc_save_current_Y = stepperY.getMilliamps(); _SAVE_SET_CURRENT(Y);
stepperY.rms_current(Y_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_Y), tmc_save_current_Y, Y_CURRENT_HOME);
#endif #endif
#if HAS_CURRENT_HOME(Y2) #if HAS_CURRENT_HOME(Y2)
const int16_t tmc_save_current_Y2 = stepperY2.getMilliamps(); _SAVE_SET_CURRENT(Y2);
stepperY2.rms_current(Y2_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_Y2), tmc_save_current_Y2, Y2_CURRENT_HOME);
#endif #endif
#if HAS_CURRENT_HOME(Z) && ENABLED(DELTA) #if HAS_CURRENT_HOME(Z)
const int16_t tmc_save_current_Z = stepperZ.getMilliamps(); _SAVE_SET_CURRENT(Z);
stepperZ.rms_current(Z_CURRENT_HOME); #endif
if (DEBUGGING(LEVELING)) debug_current(F(STR_Z), tmc_save_current_Z, Z_CURRENT_HOME); #if HAS_CURRENT_HOME(Z2)
_SAVE_SET_CURRENT(Z2);
#endif
#if HAS_CURRENT_HOME(Z3)
_SAVE_SET_CURRENT(Z3);
#endif
#if HAS_CURRENT_HOME(Z4)
_SAVE_SET_CURRENT(Z4);
#endif #endif
#if HAS_CURRENT_HOME(I) #if HAS_CURRENT_HOME(I)
const int16_t tmc_save_current_I = stepperI.getMilliamps(); _SAVE_SET_CURRENT(I);
stepperI.rms_current(I_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_I), tmc_save_current_I, I_CURRENT_HOME);
#endif #endif
#if HAS_CURRENT_HOME(J) #if HAS_CURRENT_HOME(J)
const int16_t tmc_save_current_J = stepperJ.getMilliamps(); _SAVE_SET_CURRENT(J);
stepperJ.rms_current(J_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_J), tmc_save_current_J, J_CURRENT_HOME);
#endif #endif
#if HAS_CURRENT_HOME(K) #if HAS_CURRENT_HOME(K)
const int16_t tmc_save_current_K = stepperK.getMilliamps(); _SAVE_SET_CURRENT(K);
stepperK.rms_current(K_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_K), tmc_save_current_K, K_CURRENT_HOME);
#endif #endif
#if HAS_CURRENT_HOME(U) #if HAS_CURRENT_HOME(U)
const int16_t tmc_save_current_U = stepperU.getMilliamps(); _SAVE_SET_CURRENT(U);
stepperU.rms_current(U_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_U), tmc_save_current_U, U_CURRENT_HOME);
#endif #endif
#if HAS_CURRENT_HOME(V) #if HAS_CURRENT_HOME(V)
const int16_t tmc_save_current_V = stepperV.getMilliamps(); _SAVE_SET_CURRENT(V);
stepperV.rms_current(V_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_V), tmc_save_current_V, V_CURRENT_HOME);
#endif #endif
#if HAS_CURRENT_HOME(W) #if HAS_CURRENT_HOME(W)
const int16_t tmc_save_current_W = stepperW.getMilliamps(); _SAVE_SET_CURRENT(W);
stepperW.rms_current(W_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_W), tmc_save_current_W, W_CURRENT_HOME);
#endif #endif
#if SENSORLESS_STALLGUARD_DELAY #if SENSORLESS_STALLGUARD_DELAY
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
@ -577,37 +575,46 @@ void GcodeSuite::G28() {
#if HAS_HOMING_CURRENT #if HAS_HOMING_CURRENT
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Restore driver current..."); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Restore driver current...");
#if HAS_CURRENT_HOME(X) #if HAS_CURRENT_HOME(X)
stepperX.rms_current(tmc_save_current_X); stepperX.rms_current(saved_current_X);
#endif #endif
#if HAS_CURRENT_HOME(X2) #if HAS_CURRENT_HOME(X2)
stepperX2.rms_current(tmc_save_current_X2); stepperX2.rms_current(saved_current_X2);
#endif #endif
#if HAS_CURRENT_HOME(Y) #if HAS_CURRENT_HOME(Y)
stepperY.rms_current(tmc_save_current_Y); stepperY.rms_current(saved_current_Y);
#endif #endif
#if HAS_CURRENT_HOME(Y2) #if HAS_CURRENT_HOME(Y2)
stepperY2.rms_current(tmc_save_current_Y2); stepperY2.rms_current(saved_current_Y2);
#endif #endif
#if HAS_CURRENT_HOME(Z) && ENABLED(DELTA) #if HAS_CURRENT_HOME(Z)
stepperZ.rms_current(tmc_save_current_Z); stepperZ.rms_current(saved_current_Z);
#endif
#if HAS_CURRENT_HOME(Z2)
stepperZ2.rms_current(saved_current_Z2);
#endif
#if HAS_CURRENT_HOME(Z3)
stepperZ3.rms_current(saved_current_Z3);
#endif
#if HAS_CURRENT_HOME(Z4)
stepperZ4.rms_current(saved_current_Z4);
#endif #endif
#if HAS_CURRENT_HOME(I) #if HAS_CURRENT_HOME(I)
stepperI.rms_current(tmc_save_current_I); stepperI.rms_current(saved_current_I);
#endif #endif
#if HAS_CURRENT_HOME(J) #if HAS_CURRENT_HOME(J)
stepperJ.rms_current(tmc_save_current_J); stepperJ.rms_current(saved_current_J);
#endif #endif
#if HAS_CURRENT_HOME(K) #if HAS_CURRENT_HOME(K)
stepperK.rms_current(tmc_save_current_K); stepperK.rms_current(saved_current_K);
#endif #endif
#if HAS_CURRENT_HOME(U) #if HAS_CURRENT_HOME(U)
stepperU.rms_current(tmc_save_current_U); stepperU.rms_current(saved_current_U);
#endif #endif
#if HAS_CURRENT_HOME(V) #if HAS_CURRENT_HOME(V)
stepperV.rms_current(tmc_save_current_V); stepperV.rms_current(saved_current_V);
#endif #endif
#if HAS_CURRENT_HOME(W) #if HAS_CURRENT_HOME(W)
stepperW.rms_current(tmc_save_current_W); stepperW.rms_current(saved_current_W);
#endif #endif
#if SENSORLESS_STALLGUARD_DELAY #if SENSORLESS_STALLGUARD_DELAY
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle

View file

@ -67,9 +67,9 @@ float lcd_probe_pt(const xy_pos_t &xy);
void ac_home() { void ac_home() {
endstops.enable(true); endstops.enable(true);
TERN_(SENSORLESS_HOMING, endstops.set_homing_current(true)); TERN_(SENSORLESS_HOMING, endstops.set_z_sensorless_current(true));
home_delta(); home_delta();
TERN_(SENSORLESS_HOMING, endstops.set_homing_current(false)); TERN_(SENSORLESS_HOMING, endstops.set_z_sensorless_current(false));
endstops.not_homing(); endstops.not_homing();
} }

View file

@ -1422,24 +1422,26 @@
* Conditionals based on the type of Bed Probe * Conditionals based on the type of Bed Probe
*/ */
#if HAS_BED_PROBE #if HAS_BED_PROBE
#if ALL(DELTA, SENSORLESS_PROBING)
#define HAS_DELTA_SENSORLESS_PROBING 1
#else
#define HAS_REAL_BED_PROBE 1
#endif
#if HAS_REAL_BED_PROBE && NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, Z_SPI_SENSORLESS)
#define NEED_Z_MIN_PROBE_PIN 1
#endif
#if Z_HOME_TO_MIN && (!NEED_Z_MIN_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING))
#define HOMING_Z_WITH_PROBE 1
#endif
#if DISABLED(NOZZLE_AS_PROBE) #if DISABLED(NOZZLE_AS_PROBE)
#define HAS_PROBE_XY_OFFSET 1 #define HAS_PROBE_XY_OFFSET 1
#endif #endif
#if ALL(DELTA, SENSORLESS_PROBING) #if ANY(Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE)
#define HAS_DELTA_SENSORLESS_PROBING 1 #define PROBE_TRIGGERED_WHEN_STOWED_TEST 1 // Extra test for Allen Key Probe
#endif
#if NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, HAS_DELTA_SENSORLESS_PROBING)
#define USE_Z_MIN_PROBE 1
#endif
#if Z_HOME_TO_MIN && (DISABLED(USE_Z_MIN_PROBE) || ENABLED(USE_PROBE_FOR_Z_HOMING))
#define HOMING_Z_WITH_PROBE 1
#endif #endif
#ifndef Z_PROBE_LOW_POINT #ifndef Z_PROBE_LOW_POINT
#define Z_PROBE_LOW_POINT -5 #define Z_PROBE_LOW_POINT -5
#endif #endif
#if ANY(Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE)
#define PROBE_TRIGGERED_WHEN_STOWED_TEST 1 // Extra test for Allen Key Probe
#endif
#if MULTIPLE_PROBING > 1 #if MULTIPLE_PROBING > 1
#if EXTRA_PROBING > 0 #if EXTRA_PROBING > 0
#define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING) #define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING)

View file

@ -1424,13 +1424,13 @@
#if AXIS_IS_TMC(X) #if AXIS_IS_TMC(X)
#if defined(X_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X) #if defined(X_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X)
#define X_SENSORLESS 1 #define X_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(X)
#define X_SPI_SENSORLESS 1
#endif
#endif #endif
#if AXIS_HAS_STEALTHCHOP(X) #if AXIS_HAS_STEALTHCHOP(X)
#define X_HAS_STEALTHCHOP 1 #define X_HAS_STEALTHCHOP 1
#endif #endif
#if ENABLED(SPI_ENDSTOPS)
#define X_SPI_SENSORLESS X_SENSORLESS
#endif
#ifndef X_INTERPOLATE #ifndef X_INTERPOLATE
#define X_INTERPOLATE INTERPOLATE #define X_INTERPOLATE INTERPOLATE
#endif #endif
@ -1462,13 +1462,13 @@
#if AXIS_IS_TMC(Y) #if AXIS_IS_TMC(Y)
#if defined(Y_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y) #if defined(Y_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y)
#define Y_SENSORLESS 1 #define Y_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(Y)
#define Y_SPI_SENSORLESS 1
#endif
#endif #endif
#if AXIS_HAS_STEALTHCHOP(Y) #if AXIS_HAS_STEALTHCHOP(Y)
#define Y_HAS_STEALTHCHOP 1 #define Y_HAS_STEALTHCHOP 1
#endif #endif
#if ENABLED(SPI_ENDSTOPS)
#define Y_SPI_SENSORLESS Y_SENSORLESS
#endif
#ifndef Y_INTERPOLATE #ifndef Y_INTERPOLATE
#define Y_INTERPOLATE INTERPOLATE #define Y_INTERPOLATE INTERPOLATE
#endif #endif
@ -1500,13 +1500,13 @@
#if AXIS_IS_TMC(Z) #if AXIS_IS_TMC(Z)
#if defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z) #if defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z)
#define Z_SENSORLESS 1 #define Z_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(Z)
#define Z_SPI_SENSORLESS 1
#endif
#endif #endif
#if AXIS_HAS_STEALTHCHOP(Z) #if AXIS_HAS_STEALTHCHOP(Z)
#define Z_HAS_STEALTHCHOP 1 #define Z_HAS_STEALTHCHOP 1
#endif #endif
#if ENABLED(SPI_ENDSTOPS)
#define Z_SPI_SENSORLESS Z_SENSORLESS
#endif
#ifndef Z_INTERPOLATE #ifndef Z_INTERPOLATE
#define Z_INTERPOLATE INTERPOLATE #define Z_INTERPOLATE INTERPOLATE
#endif #endif
@ -1572,13 +1572,13 @@
#if AXIS_IS_TMC(I) #if AXIS_IS_TMC(I)
#if defined(I_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(I) #if defined(I_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(I)
#define I_SENSORLESS 1 #define I_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(I)
#define I_SPI_SENSORLESS 1
#endif
#endif #endif
#if AXIS_HAS_STEALTHCHOP(I) #if AXIS_HAS_STEALTHCHOP(I)
#define I_HAS_STEALTHCHOP 1 #define I_HAS_STEALTHCHOP 1
#endif #endif
#if ENABLED(SPI_ENDSTOPS)
#define I_SPI_SENSORLESS I_SENSORLESS
#endif
#ifndef I_INTERPOLATE #ifndef I_INTERPOLATE
#define I_INTERPOLATE INTERPOLATE #define I_INTERPOLATE INTERPOLATE
#endif #endif
@ -1593,13 +1593,13 @@
#if AXIS_IS_TMC(J) #if AXIS_IS_TMC(J)
#if defined(J_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(J) #if defined(J_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(J)
#define J_SENSORLESS 1 #define J_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(J)
#define J_SPI_SENSORLESS 1
#endif
#endif #endif
#if AXIS_HAS_STEALTHCHOP(J) #if AXIS_HAS_STEALTHCHOP(J)
#define J_HAS_STEALTHCHOP 1 #define J_HAS_STEALTHCHOP 1
#endif #endif
#if ENABLED(SPI_ENDSTOPS)
#define J_SPI_SENSORLESS J_SENSORLESS
#endif
#ifndef J_INTERPOLATE #ifndef J_INTERPOLATE
#define J_INTERPOLATE INTERPOLATE #define J_INTERPOLATE INTERPOLATE
#endif #endif
@ -1614,13 +1614,13 @@
#if AXIS_IS_TMC(K) #if AXIS_IS_TMC(K)
#if defined(K_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(K) #if defined(K_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(K)
#define K_SENSORLESS 1 #define K_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(K)
#define K_SPI_SENSORLESS 1
#endif
#endif #endif
#if AXIS_HAS_STEALTHCHOP(K) #if AXIS_HAS_STEALTHCHOP(K)
#define K_HAS_STEALTHCHOP 1 #define K_HAS_STEALTHCHOP 1
#endif #endif
#if ENABLED(SPI_ENDSTOPS)
#define K_SPI_SENSORLESS K_SENSORLESS
#endif
#ifndef K_INTERPOLATE #ifndef K_INTERPOLATE
#define K_INTERPOLATE INTERPOLATE #define K_INTERPOLATE INTERPOLATE
#endif #endif
@ -1635,13 +1635,13 @@
#if AXIS_IS_TMC(U) #if AXIS_IS_TMC(U)
#if defined(U_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(U) #if defined(U_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(U)
#define U_SENSORLESS 1 #define U_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(U)
#define U_SPI_SENSORLESS 1
#endif
#endif #endif
#if AXIS_HAS_STEALTHCHOP(U) #if AXIS_HAS_STEALTHCHOP(U)
#define U_HAS_STEALTHCHOP 1 #define U_HAS_STEALTHCHOP 1
#endif #endif
#if ENABLED(SPI_ENDSTOPS)
#define U_SPI_SENSORLESS U_SENSORLESS
#endif
#ifndef U_INTERPOLATE #ifndef U_INTERPOLATE
#define U_INTERPOLATE INTERPOLATE #define U_INTERPOLATE INTERPOLATE
#endif #endif
@ -1656,13 +1656,13 @@
#if AXIS_IS_TMC(V) #if AXIS_IS_TMC(V)
#if defined(V_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(V) #if defined(V_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(V)
#define V_SENSORLESS 1 #define V_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(V)
#define V_SPI_SENSORLESS 1
#endif
#endif #endif
#if AXIS_HAS_STEALTHCHOP(V) #if AXIS_HAS_STEALTHCHOP(V)
#define V_HAS_STEALTHCHOP 1 #define V_HAS_STEALTHCHOP 1
#endif #endif
#if ENABLED(SPI_ENDSTOPS)
#define V_SPI_SENSORLESS V_SENSORLESS
#endif
#ifndef V_INTERPOLATE #ifndef V_INTERPOLATE
#define V_INTERPOLATE INTERPOLATE #define V_INTERPOLATE INTERPOLATE
#endif #endif
@ -1677,13 +1677,13 @@
#if AXIS_IS_TMC(W) #if AXIS_IS_TMC(W)
#if defined(W_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(W) #if defined(W_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(W)
#define W_SENSORLESS 1 #define W_SENSORLESS 1
#if ENABLED(SPI_ENDSTOPS) && AXIS_HAS_SPI(W)
#define W_SPI_SENSORLESS 1
#endif
#endif #endif
#if AXIS_HAS_STEALTHCHOP(W) #if AXIS_HAS_STEALTHCHOP(W)
#define W_HAS_STEALTHCHOP 1 #define W_HAS_STEALTHCHOP 1
#endif #endif
#if ENABLED(SPI_ENDSTOPS)
#define W_SPI_SENSORLESS W_SENSORLESS
#endif
#ifndef W_INTERPOLATE #ifndef W_INTERPOLATE
#define W_INTERPOLATE INTERPOLATE #define W_INTERPOLATE INTERPOLATE
#endif #endif
@ -1948,11 +1948,18 @@
#endif #endif
#endif #endif
// /**
// Endstops and bed probe * Endstop and probe flags
// * - Set USE_(AXIS)_(MIN|MAX) flags for each used endstop that has a pin, including those for DIAG0 state.
* - Note: Dual X Carriage uses "X" and "X2" steppers, but X_MIN and X_MAX endstop states (i.e., not X2_MAX).
#define _USE_STOP(A,N,M,C) ((A##_HOME_TO_##M || (C+0)) && PIN_EXISTS(A##N##_##M)) * - Set a HAS_(AXIS)_(MIN|MAX)_STATE flag for each endstop that has a state, including SPI Sensorless which don't use a pin.
* - Set a HAS_(AXIS)_STATE flag for each axis that has at least one state.
* - Consider (AXIS)_SAFETY_STOP for the case where the axis has a second endstop.
* Currently this must be distinct, but we can add a mechanism to use the same pin for sensorless
* or switches wired to the same pin, or for the single SPI stall state on the axis.
*/
#define _USE_STOP(A,N,M,C) ((ANY(A##_HOME_TO_##M, A##N##_SAFETY_STOP) || (C+0)) && PIN_EXISTS(A##N##_##M) && !A##_SPI_SENSORLESS)
#define _HAS_STATE(A,N,M) (USE_##A##N##_##M || (ANY(A##_HOME_TO_##M, A##N##_SAFETY_STOP) && A##_SPI_SENSORLESS))
#if _USE_STOP(X,,MIN,) #if _USE_STOP(X,,MIN,)
#define USE_X_MIN 1 #define USE_X_MIN 1
@ -1960,139 +1967,239 @@
#if _USE_STOP(X,,MAX,ENABLED(DUAL_X_CARRIAGE)) #if _USE_STOP(X,,MAX,ENABLED(DUAL_X_CARRIAGE))
#define USE_X_MAX 1 #define USE_X_MAX 1
#endif #endif
#if USE_X_MIN || USE_X_MAX #if _HAS_STATE(X,,MIN)
#define HAS_X_ENDSTOP 1 #define HAS_X_MIN_STATE 1
#endif
#if _HAS_STATE(X,,MAX)
#define HAS_X_MAX_STATE 1
#endif
#if HAS_X_MIN_STATE || HAS_X_MAX_STATE
#define HAS_X_STATE 1
#endif #endif
#if _USE_STOP(Y,,MIN,) #if _USE_STOP(Y,,MIN,)
#define USE_Y_MIN 1 #define USE_Y_MIN 1
#elif _USE_STOP(Y,,MAX,) #endif
#if _USE_STOP(Y,,MAX,)
#define USE_Y_MAX 1 #define USE_Y_MAX 1
#endif #endif
#if USE_Y_MIN || USE_Y_MAX #if _HAS_STATE(Y,,MIN)
#define HAS_Y_ENDSTOP 1 #define HAS_Y_MIN_STATE 1
#endif
#if _HAS_STATE(Y,,MAX)
#define HAS_Y_MAX_STATE 1
#endif
#if HAS_Y_MIN_STATE || HAS_Y_MAX_STATE
#define HAS_Y_STATE 1
#endif #endif
#if _USE_STOP(Z,,MIN,ANY(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, HAS_DELTA_SENSORLESS_PROBING)) #if _USE_STOP(Z,,MIN,ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))
#define USE_Z_MIN 1 #define USE_Z_MIN 1
#if !HAS_DELTA_SENSORLESS_PROBING
#define HAS_Z_MIN_PIN 1
#endif
#endif #endif
#if _USE_STOP(Z,,MAX,) #if _USE_STOP(Z,,MAX,)
#define USE_Z_MAX 1 #define USE_Z_MAX 1
#endif #endif
#if USE_Z_MIN || USE_Z_MAX #if _HAS_STATE(Z,,MIN)
#define HAS_Z_ENDSTOP 1 #define HAS_Z_MIN_STATE 1
#endif
#if _HAS_STATE(Z,,MAX)
#define HAS_Z_MAX_STATE 1
#endif
#if HAS_Z_MIN_STATE || HAS_Z_MAX_STATE
#define HAS_Z_STATE 1
#endif #endif
#if _USE_STOP(I,,MIN,) #if _USE_STOP(I,,MIN,)
#define USE_I_MIN 1 #define USE_I_MIN 1
#elif _USE_STOP(I,,MAX,) #endif
#if _USE_STOP(I,,MAX,)
#define USE_I_MAX 1 #define USE_I_MAX 1
#endif #endif
#if USE_I_MIN || USE_I_MAX #if _HAS_STATE(I,,MIN)
#define HAS_I_ENDSTOP 1 #define HAS_I_MIN_STATE 1
#endif
#if _HAS_STATE(I,,MAX)
#define HAS_I_MAX_STATE 1
#endif
#if HAS_I_MIN_STATE || HAS_I_MAX_STATE
#define HAS_I_STATE 1
#endif #endif
#if _USE_STOP(J,,MIN,) #if _USE_STOP(J,,MIN,)
#define USE_J_MIN 1 #define USE_J_MIN 1
#elif _USE_STOP(J,,MAX,) #endif
#if _USE_STOP(J,,MAX,)
#define USE_J_MAX 1 #define USE_J_MAX 1
#endif #endif
#if USE_J_MIN || USE_J_MAX #if _HAS_STATE(J,,MIN)
#define HAS_J_ENDSTOP 1 #define HAS_J_MIN_STATE 1
#endif
#if _HAS_STATE(J,,MAX)
#define HAS_J_MAX_STATE 1
#endif
#if HAS_J_MIN_STATE || HAS_J_MAX_STATE
#define HAS_J_STATE 1
#endif #endif
#if _USE_STOP(K,,MIN,) #if _USE_STOP(K,,MIN,)
#define USE_K_MIN 1 #define USE_K_MIN 1
#elif _USE_STOP(K,,MAX,) #endif
#if _USE_STOP(K,,MAX,)
#define USE_K_MAX 1 #define USE_K_MAX 1
#endif #endif
#if USE_K_MIN || USE_K_MAX #if _HAS_STATE(K,,MIN)
#define HAS_K_ENDSTOP 1 #define HAS_K_MIN_STATE 1
#endif
#if _HAS_STATE(K,,MAX)
#define HAS_K_MAX_STATE 1
#endif
#if HAS_K_MIN_STATE || HAS_K_MAX_STATE
#define HAS_K_STATE 1
#endif #endif
#if _USE_STOP(U,,MIN,) #if _USE_STOP(U,,MIN,)
#define USE_U_MIN 1 #define USE_U_MIN 1
#elif _USE_STOP(U,,MAX,) #endif
#if _USE_STOP(U,,MAX,)
#define USE_U_MAX 1 #define USE_U_MAX 1
#endif #endif
#if USE_U_MIN || USE_U_MAX #if _HAS_STATE(U,,MIN)
#define HAS_U_ENDSTOP 1 #define HAS_U_MIN_STATE 1
#endif
#if _HAS_STATE(U,,MAX)
#define HAS_U_MAX_STATE 1
#endif
#if HAS_U_MIN_STATE || HAS_U_MAX_STATE
#define HAS_U_STATE 1
#endif #endif
#if _USE_STOP(V,,MIN,) #if _USE_STOP(V,,MIN,)
#define USE_V_MIN 1 #define USE_V_MIN 1
#elif _USE_STOP(V,,MAX,) #endif
#if _USE_STOP(V,,MAX,)
#define USE_V_MAX 1 #define USE_V_MAX 1
#endif #endif
#if USE_V_MIN || USE_V_MAX #if _HAS_STATE(V,,MIN)
#define HAS_V_ENDSTOP 1 #define HAS_V_MIN_STATE 1
#endif
#if _HAS_STATE(V,,MAX)
#define HAS_V_MAX_STATE 1
#endif
#if HAS_V_MIN_STATE || HAS_V_MAX_STATE
#define HAS_V_STATE 1
#endif #endif
#if _USE_STOP(W,,MIN,) #if _USE_STOP(W,,MIN,)
#define USE_W_MIN 1 #define USE_W_MIN 1
#elif _USE_STOP(W,,MAX,) #endif
#if _USE_STOP(W,,MAX,)
#define USE_W_MAX 1 #define USE_W_MAX 1
#endif #endif
#if USE_W_MIN || USE_W_MAX #if _HAS_STATE(W,,MIN)
#define HAS_W_ENDSTOP 1 #define HAS_W_MIN_STATE 1
#endif
#if _HAS_STATE(W,,MAX)
#define HAS_W_MAX_STATE 1
#endif
#if HAS_W_MIN_STATE || HAS_W_MAX_STATE
#define HAS_W_STATE 1
#endif #endif
#if ANY(DUAL_X_CARRIAGE, X_DUAL_ENDSTOPS) #if ENABLED(X_DUAL_ENDSTOPS)
#if _USE_STOP(X,2,MIN,) #if _USE_STOP(X,2,MIN,)
#define USE_X2_MIN 1 #define USE_X2_MIN 1
#elif _USE_STOP(X,2,MAX,) #endif
#if _USE_STOP(X,2,MAX,)
#define USE_X2_MAX 1 #define USE_X2_MAX 1
#endif #endif
#if USE_X2_MIN || USE_X2_MAX #if _HAS_STATE(X,2,MIN) || HAS_X_MIN_STATE
#define HAS_X2_ENDSTOP 1 #define HAS_X2_MIN_STATE 1
#endif
#if _HAS_STATE(X,2,MAX) || HAS_X_MAX_STATE
#define HAS_X2_MAX_STATE 1
#endif
#if HAS_X2_MIN_STATE || HAS_X2_MAX_STATE
#define HAS_X2_STATE 1
#endif #endif
#endif #endif
#if ENABLED(Y_DUAL_ENDSTOPS) #if ENABLED(Y_DUAL_ENDSTOPS)
#if _USE_STOP(Y,2,MIN,) #if _USE_STOP(Y,2,MIN,)
#define USE_Y2_MIN 1 #define USE_Y2_MIN 1
#elif _USE_STOP(Y,2,MAX,) #endif
#if _USE_STOP(Y,2,MAX,)
#define USE_Y2_MAX 1 #define USE_Y2_MAX 1
#endif #endif
#if USE_Y2_MIN || USE_Y2_MAX #if _HAS_STATE(Y,2,MIN) || HAS_Y_MIN_STATE
#define HAS_Y2_ENDSTOP 1 #define HAS_Y2_MIN_STATE 1
#endif
#if _HAS_STATE(Y,2,MAX) || HAS_Y_MAX_STATE
#define HAS_Y2_MAX_STATE 1
#endif
#if HAS_Y2_MIN_STATE || HAS_Y2_MAX_STATE
#define HAS_Y2_STATE 1
#endif #endif
#endif #endif
#if ENABLED(Z_MULTI_ENDSTOPS) #if ENABLED(Z_MULTI_ENDSTOPS)
#if _USE_STOP(Z,2,MIN,) #if _USE_STOP(Z,2,MIN,)
#define USE_Z2_MIN 1 #define USE_Z2_MIN 1
#elif _USE_STOP(Z,2,MAX,) #endif
#if _USE_STOP(Z,2,MAX,)
#define USE_Z2_MAX 1 #define USE_Z2_MAX 1
#endif #endif
#if USE_Z2_MIN || USE_Z2_MAX #if _HAS_STATE(Z,2,MIN) || HAS_Z_MIN_STATE
#define HAS_Z2_ENDSTOP 1 #define HAS_Z2_MIN_STATE 1
#endif
#if _HAS_STATE(Z,2,MAX) || HAS_Z_MAX_STATE
#define HAS_Z2_MAX_STATE 1
#endif
#if HAS_Z2_MIN_STATE || HAS_Z2_MAX_STATE
#define HAS_Z2_STATE 1
#endif #endif
#if NUM_Z_STEPPERS >= 3 #if NUM_Z_STEPPERS >= 3
#if _USE_STOP(Z,3,MIN,) #if _USE_STOP(Z,3,MIN,)
#define USE_Z3_MIN 1 #define USE_Z3_MIN 1
#elif _USE_STOP(Z,3,MAX,) #endif
#if _USE_STOP(Z,3,MAX,)
#define USE_Z3_MAX 1 #define USE_Z3_MAX 1
#endif #endif
#if USE_Z3_MIN || USE_Z3_MAX #if _HAS_STATE(Z,3,MIN) || HAS_Z_MIN_STATE
#define HAS_Z3_ENDSTOP 1 #define HAS_Z3_MIN_STATE 1
#endif
#if _HAS_STATE(Z,3,MAX) || HAS_Z_MAX_STATE
#define HAS_Z3_MAX_STATE 1
#endif
#if HAS_Z3_MIN_STATE || HAS_Z3_MAX_STATE
#define HAS_Z3_STATE 1
#endif #endif
#endif #endif
#if NUM_Z_STEPPERS >= 4 #if NUM_Z_STEPPERS >= 4
#if _USE_STOP(Z,4,MIN,) #if _USE_STOP(Z,4,MIN,)
#define USE_Z4_MIN 1 #define USE_Z4_MIN 1
#elif _USE_STOP(Z,4,MAX,) #endif
#if _USE_STOP(Z,4,MAX,)
#define USE_Z4_MAX 1 #define USE_Z4_MAX 1
#endif #endif
#if USE_Z4_MIN || USE_Z4_MAX #if _HAS_STATE(Z,4,MIN) || HAS_Z_MIN_STATE
#define HAS_Z4_ENDSTOP 1 #define HAS_Z4_MIN_STATE 1
#endif
#if _HAS_STATE(Z,4,MAX) || HAS_Z_MAX_STATE
#define HAS_Z4_MAX_STATE 1
#endif
#if HAS_Z4_MIN_STATE || HAS_Z4_MAX_STATE
#define HAS_Z4_STATE 1
#endif #endif
#endif #endif
#endif #endif
#if NEED_Z_MIN_PROBE_PIN && PIN_EXISTS(Z_MIN_PROBE)
#define USE_Z_MIN_PROBE 1
#endif
#if HAS_REAL_BED_PROBE
#define HAS_Z_PROBE_STATE 1
#endif
#undef _USE_STOP #undef _USE_STOP
/** /**
@ -2111,7 +2218,7 @@
#if USE_Y_MAX #if USE_Y_MAX
#define ENDSTOPPULLUP_YMAX #define ENDSTOPPULLUP_YMAX
#endif #endif
#if HAS_Z_MIN_PIN #if USE_Z_MIN
#define ENDSTOPPULLUP_ZMIN #define ENDSTOPPULLUP_ZMIN
#endif #endif
#if USE_Z_MAX #if USE_Z_MAX

View file

@ -1388,19 +1388,13 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
/** /**
* Require pin options and pins to be defined * Require pin options and pins to be defined
*/ */
#if ENABLED(SENSORLESS_PROBING) #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS) #if !USE_Z_MIN
#error "SENSORLESS_PROBING requires TMC2130/2160/2209/5130/5160 drivers on X, Y, and Z and {X|Y|Z}_STALL_SENSITIVITY."
#elif !Z_SENSORLESS
#error "SENSORLESS_PROBING requires a TMC2130/2160/2209/5130/5160 driver on Z and Z_STALL_SENSITIVITY."
#endif
#elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if !HAS_Z_MIN_PIN
#error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined." #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
#elif Z_MIN_PROBE_ENDSTOP_HIT_STATE != Z_MIN_ENDSTOP_HIT_STATE #elif Z_MIN_PROBE_ENDSTOP_HIT_STATE != Z_MIN_ENDSTOP_HIT_STATE
#error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_HIT_STATE to match Z_MIN_PROBE_ENDSTOP_HIT_STATE." #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_HIT_STATE to match Z_MIN_PROBE_ENDSTOP_HIT_STATE."
#endif #endif
#elif !USE_Z_MIN_PROBE #elif !PIN_EXISTS(Z_MIN_PROBE)
#error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled." #error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled."
#endif #endif
@ -2323,53 +2317,53 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
/** /**
* Endstop Tests * Endstop Tests
*/ */
#if HAS_ENDSTOPS #if !IS_SCARA
// Delta and Cartesian use 3 homing endstops // Delta and Cartesian require some kind of endstop
#if NONE(IS_SCARA, SPI_ENDSTOPS) #if X_HOME_TO_MIN && !HAS_X_MIN_STATE
#if X_HOME_TO_MIN && !PIN_EXISTS(X_MIN) #error "X_MIN_PIN, X_STOP_PIN, or X_SPI_SENSORLESS is required for X axis homing."
#error "X_MIN_PIN (or X_STOP_PIN) is required for X axis homing." #elif X_HOME_TO_MAX && !HAS_X_MAX_STATE
#elif X_HOME_TO_MAX && !PIN_EXISTS(X_MAX) #error "X_MAX_PIN, X_STOP_PIN, or X_SPI_SENSORLESS is required for X axis homing."
#error "X_MAX_PIN (or X_STOP_PIN) is required for X axis homing." #elif Y_HOME_TO_MIN && !HAS_Y_MIN_STATE
#elif Y_HOME_TO_MIN && !PIN_EXISTS(Y_MIN) #error "Y_MIN_PIN, Y_STOP_PIN, or Y_SPI_SENSORLESS is required for Y axis homing."
#error "Y_MIN_PIN (or Y_STOP_PIN) is required for Y axis homing." #elif Y_HOME_TO_MAX && !HAS_Y_MAX_STATE
#elif Y_HOME_TO_MAX && !PIN_EXISTS(Y_MAX) #error "Y_MAX_PIN, Y_STOP_PIN, or Y_SPI_SENSORLESS is required for Y axis homing."
#error "Y_MAX_PIN (or Y_STOP_PIN) is required for Y axis homing." #elif Z_HOME_TO_MIN && !HAS_Z_MIN_STATE
#elif I_HOME_TO_MIN && !PIN_EXISTS(I_MIN) #error "Z_MIN_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Y axis homing."
#error "I_MIN_PIN (or I_STOP_PIN) is required for I axis homing." #elif Z_HOME_TO_MAX && !HAS_Z_MAX_STATE
#elif I_HOME_TO_MAX && !PIN_EXISTS(I_MAX) #error "Z_MAX_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Y axis homing."
#error "I_MAX_PIN (or I_STOP_PIN) is required for I axis homing." #elif I_HOME_TO_MIN && !HAS_I_MIN_STATE
#elif J_HOME_TO_MIN && !PIN_EXISTS(J_MIN) #error "I_MIN_PIN, I_STOP_PIN, or I_SPI_SENSORLESS is required for I axis homing."
#error "J_MIN_PIN (or J_STOP_PIN) is required for J axis homing." #elif I_HOME_TO_MAX && !HAS_I_MAX_STATE
#elif J_HOME_TO_MAX && !PIN_EXISTS(J_MAX) #error "I_MAX_PIN, I_STOP_PIN, or I_SPI_SENSORLESS is required for I axis homing."
#error "J_MAX_PIN (or J_STOP_PIN) is required for J axis homing." #elif J_HOME_TO_MIN && !HAS_J_MIN_STATE
#elif K_HOME_TO_MIN && !PIN_EXISTS(K_MIN) #error "J_MIN_PIN, J_STOP_PIN, or J_SPI_SENSORLESS is required for J axis homing."
#error "K_MIN_PIN (or K_STOP_PIN) is required for K axis homing." #elif J_HOME_TO_MAX && !HAS_J_MAX_STATE
#elif K_HOME_TO_MAX && !PIN_EXISTS(K_MAX) #error "J_MAX_PIN, J_STOP_PIN, or J_SPI_SENSORLESS is required for J axis homing."
#error "K_MAX_PIN (or K_STOP_PIN) is required for K axis homing." #elif K_HOME_TO_MIN && !HAS_K_MIN_STATE
#elif U_HOME_TO_MIN && !PIN_EXISTS(U_MIN) #error "K_MIN_PIN, K_STOP_PIN, or K_SPI_SENSORLESS is required for K axis homing."
#error "U_MIN_PIN (or U_STOP_PIN) is required for U axis homing." #elif K_HOME_TO_MAX && !HAS_K_MAX_STATE
#elif U_HOME_TO_MAX && !PIN_EXISTS(U_MAX) #error "K_MAX_PIN, K_STOP_PIN, or K_SPI_SENSORLESS is required for K axis homing."
#error "U_MAX_PIN (or U_STOP_PIN) is required for U axis homing." #elif U_HOME_TO_MIN && !HAS_U_MIN_STATE
#elif V_HOME_TO_MIN && !PIN_EXISTS(V_MIN) #error "U_MIN_PIN, U_STOP_PIN, or U_SPI_SENSORLESS is required for U axis homing."
#error "V_MIN_PIN (or V_STOP_PIN) is required for V axis homing." #elif U_HOME_TO_MAX && !HAS_U_MAX_STATE
#elif V_HOME_TO_MAX && !PIN_EXISTS(V_MAX) #error "U_MAX_PIN, U_STOP_PIN, or U_SPI_SENSORLESS is required for U axis homing."
#error "V_MAX_PIN (or V_STOP_PIN) is required for V axis homing." #elif V_HOME_TO_MIN && !HAS_V_MIN_STATE
#elif W_HOME_TO_MIN && !PIN_EXISTS(W_MIN) #error "V_MIN_PIN, V_STOP_PIN, or V_SPI_SENSORLESS is required for V axis homing."
#error "W_MIN_PIN (or W_STOP_PIN) is required for W axis homing." #elif V_HOME_TO_MAX && !HAS_V_MAX_STATE
#elif W_HOME_TO_MAX && !PIN_EXISTS(W_MAX) #error "V_MAX_PIN, V_STOP_PIN, or V_SPI_SENSORLESS is required for V axis homing."
#error "W_MAX_PIN (or W_STOP_PIN) is required for W axis homing." #elif W_HOME_TO_MIN && !HAS_W_MIN_STATE
#endif #error "W_MIN_PIN, W_STOP_PIN, or W_SPI_SENSORLESS is required for W axis homing."
#endif #elif W_HOME_TO_MAX && !HAS_W_MAX_STATE
#error "W_MAX_PIN, W_STOP_PIN, or W_SPI_SENSORLESS is required for W axis homing."
// Z homing requirements
#if Z_HOME_TO_MAX && ENABLED(USE_PROBE_FOR_Z_HOMING)
#error "Z_HOME_DIR must be -1 when homing Z with the probe."
#elif ALL(HOMING_Z_WITH_PROBE, Z_MULTI_ENDSTOPS)
#error "Z_MULTI_ENDSTOPS is incompatible with USE_PROBE_FOR_Z_HOMING."
#endif #endif
#endif #endif
#if ALL(HOME_Z_FIRST, USE_PROBE_FOR_Z_HOMING) // Z homing with probe requirements
#if ALL(HOMING_Z_WITH_PROBE, Z_MULTI_ENDSTOPS)
#error "Z_MULTI_ENDSTOPS is incompatible with USE_PROBE_FOR_Z_HOMING (i.e., Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)."
#elif ALL(USE_PROBE_FOR_Z_HOMING, Z_HOME_TO_MAX)
#error "Z_HOME_DIR must be -1 when homing Z with the probe."
#elif ALL(USE_PROBE_FOR_Z_HOMING, HOME_Z_FIRST)
#error "HOME_Z_FIRST can't be used when homing Z with a probe." #error "HOME_Z_FIRST can't be used when homing Z with a probe."
#endif #endif
@ -2381,26 +2375,32 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#if ENABLED(X_DUAL_ENDSTOPS) #if ENABLED(X_DUAL_ENDSTOPS)
#if ENABLED(DELTA) #if ENABLED(DELTA)
#error "X_DUAL_ENDSTOPS is not compatible with DELTA." #error "X_DUAL_ENDSTOPS is not compatible with DELTA."
#elif !HAS_X2_ENDSTOP #elif !HAS_X2_STATE
#error "X2 Endstop Pin must be defined for X_DUAL_ENDSTOPS." #error "Some kind of X2 Endstop must be defined for X_DUAL_ENDSTOPS."
#elif X_SPI_SENSORLESS && !AXIS_HAS_SPI(X2)
#error "All X Stepper Drivers must be SPI-capable to use SPI Endstops on X."
#endif #endif
#endif #endif
#if ENABLED(Y_DUAL_ENDSTOPS) #if ENABLED(Y_DUAL_ENDSTOPS)
#if ENABLED(DELTA) #if ENABLED(DELTA)
#error "Y_DUAL_ENDSTOPS is not compatible with DELTA." #error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
#elif !HAS_Y2_ENDSTOP #elif !HAS_Y2_STATE
#error "Y2 Endstop Pin must be defined for Y_DUAL_ENDSTOPS." #error "Some kind of Y2 Endstop must be defined for Y_DUAL_ENDSTOPS."
#elif Y_SPI_SENSORLESS && !AXIS_HAS_SPI(Y2)
#error "All Y Stepper Drivers must be SPI-capable to use SPI Endstops on Y."
#endif #endif
#endif #endif
#if ENABLED(Z_MULTI_ENDSTOPS) #if ENABLED(Z_MULTI_ENDSTOPS)
#if ENABLED(DELTA) #if ENABLED(DELTA)
#error "Z_MULTI_ENDSTOPS is not compatible with DELTA." #error "Z_MULTI_ENDSTOPS is not compatible with DELTA."
#elif !HAS_Z2_ENDSTOP #elif !HAS_Z2_STATE
#error "Z2 Endstop Pin must be defined for Z_MULTI_ENDSTOPS." #error "Some kind of Z2 Endstop must be defined for Z_MULTI_ENDSTOPS."
#elif NUM_Z_STEPPERS >= 3 && !HAS_Z3_ENDSTOP #elif NUM_Z_STEPPERS >= 3 && !HAS_Z3_STATE
#error "Z3 Endstop Pin must be defined for Z_MULTI_ENDSTOPS and Z3_DRIVER_TYPE." #error "Some kind of Z3 Endstop must be defined for Z_MULTI_ENDSTOPS and Z3_DRIVER_TYPE."
#elif NUM_Z_STEPPERS >= 4 && !HAS_Z4_ENDSTOP #elif NUM_Z_STEPPERS >= 4 && !HAS_Z4_STATE
#error "Z4 Endstop Pin must be defined for Z_MULTI_ENDSTOPS and Z4_DRIVER_TYPE." #error "Some kind of Z4 Endstop must be defined for Z_MULTI_ENDSTOPS and Z4_DRIVER_TYPE."
#elif Z_SPI_SENSORLESS && !(AXIS_HAS_SPI(Z2) && (NUM_Z_STEPPERS < 3 || AXIS_HAS_SPI(Z3)) && (NUM_Z_STEPPERS < 4 || AXIS_HAS_SPI(Z4)))
#error "All Z Stepper Drivers must be SPI-capable to use SPI Endstops on Z."
#endif #endif
#endif #endif

View file

@ -70,9 +70,9 @@ void ESDiag::draw() {
DWINUI::drawButton(BTN_Continue, 86, 250); DWINUI::drawButton(BTN_Continue, 86, 250);
DWINUI::cursor.y = 80; DWINUI::cursor.y = 80;
#define ES_LABEL(S) draw_es_label(F(STR_##S)) #define ES_LABEL(S) draw_es_label(F(STR_##S))
TERN_(USE_X_MIN, ES_LABEL(X_MIN)); TERN_(USE_X_MAX, ES_LABEL(X_MAX)); TERN_(USE_X_MIN, ES_LABEL(X_MIN)); TERN_(USE_X_MAX, ES_LABEL(X_MAX));
TERN_(USE_Y_MIN, ES_LABEL(Y_MIN)); TERN_(USE_Y_MAX, ES_LABEL(Y_MAX)); TERN_(USE_Y_MIN, ES_LABEL(Y_MIN)); TERN_(USE_Y_MAX, ES_LABEL(Y_MAX));
TERN_(HAS_Z_MIN_PIN, ES_LABEL(Z_MIN)); TERN_(USE_Z_MAX, ES_LABEL(Z_MAX)); TERN_(USE_Z_MIN, ES_LABEL(Z_MIN)); TERN_(USE_Z_MAX, ES_LABEL(Z_MAX));
TERN_(HAS_FILAMENT_SENSOR, draw_es_label(F(STR_FILAMENT))); TERN_(HAS_FILAMENT_SENSOR, draw_es_label(F(STR_FILAMENT)));
update(); update();
} }
@ -80,9 +80,9 @@ void ESDiag::draw() {
void ESDiag::update() { void ESDiag::update() {
DWINUI::cursor.y = 80; DWINUI::cursor.y = 80;
#define ES_REPORT(S) draw_es_state(READ(S##_PIN) == S##_ENDSTOP_HIT_STATE) #define ES_REPORT(S) draw_es_state(READ(S##_PIN) == S##_ENDSTOP_HIT_STATE)
TERN_(USE_X_MIN, ES_REPORT(X_MIN)); TERN_(USE_X_MAX, ES_REPORT(X_MAX)); TERN_(USE_X_MIN, ES_REPORT(X_MIN)); TERN_(USE_X_MAX, ES_REPORT(X_MAX));
TERN_(USE_Y_MIN, ES_REPORT(Y_MIN)); TERN_(USE_Y_MAX, ES_REPORT(Y_MAX)); TERN_(USE_Y_MIN, ES_REPORT(Y_MIN)); TERN_(USE_Y_MAX, ES_REPORT(Y_MAX));
TERN_(HAS_Z_MIN_PIN, ES_REPORT(Z_MIN)); TERN_(USE_Z_MAX, ES_REPORT(Z_MAX)); TERN_(USE_Z_MIN, ES_REPORT(Z_MIN)); TERN_(USE_Z_MAX, ES_REPORT(Z_MAX));
TERN_(HAS_FILAMENT_SENSOR, draw_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE)); TERN_(HAS_FILAMENT_SENSOR, draw_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE));
dwinUpdateLCD(); dwinUpdateLCD();
} }

View file

@ -79,7 +79,7 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) {
#else #else
PIN_DISABLED(3, 3, PSTR(STR_Y_MIN), Y_MIN) PIN_DISABLED(3, 3, PSTR(STR_Y_MIN), Y_MIN)
#endif #endif
#if HAS_Z_MIN_PIN #if USE_Z_MIN
PIN_ENABLED (5, 3, PSTR(STR_Z_MIN), Z_MIN, Z_MIN_ENDSTOP_HIT_STATE) PIN_ENABLED (5, 3, PSTR(STR_Z_MIN), Z_MIN, Z_MIN_ENDSTOP_HIT_STATE)
#else #else
PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN) PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN)

View file

@ -45,36 +45,56 @@
#if PIN_EXISTS(MT_DET_2) #if PIN_EXISTS(MT_DET_2)
bool mt_det2_sta; bool mt_det2_sta;
#endif #endif
#if HAS_X_ENDSTOP #if USE_X_MIN
bool endstopx1_sta; bool endstopx1_min;
#else #else
constexpr static bool endstopx1_sta = true; constexpr static bool endstopx1_min = true;
#endif #endif
#if HAS_X2_ENDSTOP #if USE_X_MAX
bool endstopx1_max;
#else
constexpr static bool endstopx1_max = true;
#endif
#if USE_X2_MIN
bool endstopx2_sta; bool endstopx2_sta;
#else #else
constexpr static bool endstopx2_sta = true; constexpr static bool endstopx2_sta = true;
#endif #endif
#if HAS_Y_ENDSTOP #if USE_Y_MIN
bool endstopy1_sta; bool endstopy1_sta;
#else #else
constexpr static bool endstopy1_sta = true; constexpr static bool endstopy1_sta = true;
#endif #endif
#if HAS_Y2_ENDSTOP #if USE_Y2_MIN
bool endstopy2_sta; bool endstopy2_sta;
#else #else
constexpr static bool endstopy2_sta = true; constexpr static bool endstopy2_sta = true;
#endif #endif
#if HAS_Z_ENDSTOP #if USE_Z_MIN
bool endstopz1_sta; bool endstopz1_min;
#else #else
constexpr static bool endstopz1_sta = true; constexpr static bool endstopz1_min = true;
#endif #endif
#if HAS_Z2_ENDSTOP #if USE_Z_MAX
bool endstopz1_max;
#else
constexpr static bool endstopz1_max = true;
#endif
#if USE_Z2_MIN || USE_Z2_MAX
bool endstopz2_sta; bool endstopz2_sta;
#else #else
constexpr static bool endstopz2_sta = true; constexpr static bool endstopz2_sta = true;
#endif #endif
#if USE_Z3_MIN || USE_Z3_MAX
bool endstopz3_sta;
#else
constexpr static bool endstopz3_sta = true;
#endif
#if USE_Z4_MIN || USE_Z4_MAX
bool endstopz4_sta;
#else
constexpr static bool endstopz4_sta = true;
#endif
#define ESTATE(S) (READ(S##_PIN) == S##_ENDSTOP_HIT_STATE) #define ESTATE(S) (READ(S##_PIN) == S##_ENDSTOP_HIT_STATE)
@ -87,12 +107,28 @@
#if PIN_EXISTS(MT_DET_2) #if PIN_EXISTS(MT_DET_2)
mt_det2_sta = (READ(MT_DET_2_PIN) == LOW); mt_det2_sta = (READ(MT_DET_2_PIN) == LOW);
#endif #endif
TERN_(HAS_X_ENDSTOP, endstopx1_sta = ESTATE(TERN(USE_X_MIN, X_MIN, X_MAX))); TERN_(USE_X_MIN, endstopx1_min = ESTATE(X_MIN));
TERN_(HAS_X2_ENDSTOP, endstopx2_sta = ESTATE(TERN(USE_X2_MIN, X2_MIN, X2_MAX))); TERN_(USE_X_MAX, endstopx1_max = ESTATE(X_MAX));
TERN_(HAS_Y_ENDSTOP, endstopy1_sta = ESTATE(TERN(USE_Y_MIN, Y_MIN, Y_MAX))); #if USE_X2_MIN || USE_X2_MAX
TERN_(HAS_Y2_ENDSTOP, endstopy2_sta = ESTATE(TERN(USE_Y2_MIN, Y2_MIN, Y2_MAX))); endstopx2_sta = ESTATE(TERN(USE_X2_MIN, X2_MIN, X2_MAX));
TERN_(HAS_Z_ENDSTOP, endstopz1_sta = ESTATE(TERN(HAS_Z_MIN_PIN, Z_MIN, Z_MAX))); #endif
TERN_(HAS_Z2_ENDSTOP, endstopz2_sta = ESTATE(TERN(USE_Z2_MIN, Z2_MIN, Z2_MAX))); #if USE_Y_MIN || USE_Y_MAX
endstopy1_sta = ESTATE(TERN(USE_Y_MIN, Y_MIN, Y_MAX));
#endif
#if USE_Y2_MIN || USE_Y2_MAX
endstopy2_sta = ESTATE(TERN(USE_Y2_MIN, Y2_MIN, Y2_MAX));
#endif
TERN_(USE_Z_MIN, endstopz1_min = ESTATE(Z_MIN));
TERN_(USE_Z_MAX, endstopz1_max = ESTATE(Z_MAX));
#if USE_Z2_MIN || USE_Z2_MAX
endstopz2_sta = ESTATE(TERN(USE_Z2_MIN, Z2_MIN, Z2_MAX));
#endif
#if USE_Z3_MIN || USE_Z3_MAX
endstopz3_sta = ESTATE(TERN(USE_Z3_MIN, Z3_MIN, Z3_MAX));
#endif
#if USE_Z4_MIN || USE_Z4_MAX
endstopz4_sta = ESTATE(TERN(USE_Z4_MIN, Z4_MIN, Z4_MAX));
#endif
} }
void test_gpio_readlevel_H() { void test_gpio_readlevel_H() {
@ -104,12 +140,28 @@
#if PIN_EXISTS(MT_DET_2) #if PIN_EXISTS(MT_DET_2)
mt_det2_sta = (READ(MT_DET_2_PIN) == HIGH); mt_det2_sta = (READ(MT_DET_2_PIN) == HIGH);
#endif #endif
TERN_(HAS_X_ENDSTOP, endstopx1_sta = !ESTATE(TERN(USE_X_MIN, X_MIN, X_MAX))); TERN_(USE_X_MIN, endstopx1_min = !ESTATE(X_MIN));
TERN_(HAS_X2_ENDSTOP, endstopx2_sta = !ESTATE(TERN(USE_X2_MIN, X2_MIN, X2_MAX))); TERN_(USE_X_MAX, endstopx1_max = !ESTATE(X_MAX));
TERN_(HAS_Y_ENDSTOP, endstopy1_sta = !ESTATE(TERN(USE_Y_MIN, Y_MIN, Y_MAX))); #if USE_X2_MIN || USE_X2_MAX
TERN_(HAS_Y2_ENDSTOP, endstopy2_sta = !ESTATE(TERN(USE_Y2_MIN, Y2_MIN, Y2_MAX))); endstopx2_sta = !ESTATE(TERN(USE_X2_MIN, X2_MIN, X2_MAX));
TERN_(HAS_Z_ENDSTOP, endstopz1_sta = !ESTATE(TERN(HAS_Z_MIN_PIN, Z_MIN, Z_MAX))); #endif
TERN_(HAS_Z2_ENDSTOP, endstopz2_sta = !ESTATE(TERN(USE_Z2_MIN, Z2_MIN, Z2_MAX))); #if USE_Y_MIN || USE_Y_MAX
endstopy1_sta = !ESTATE(TERN(USE_Y_MIN, Y_MIN, Y_MAX));
#endif
#if USE_Y2_MIN || USE_Y2_MAX
endstopy2_sta = !ESTATE(TERN(USE_Y2_MIN, Y2_MIN, Y2_MAX));
#endif
TERN_(USE_Z_MIN, endstopz1_min = !ESTATE(Z_MIN));
TERN_(USE_Z_MAX, endstopz1_max = !ESTATE(Z_MAX));
#if USE_Z2_MIN || USE_Z2_MAX
endstopz2_sta = !ESTATE(TERN(USE_Z2_MIN, Z2_MIN, Z2_MAX));
#endif
#if USE_Z3_MIN || USE_Z3_MAX
endstopz3_sta = !ESTATE(TERN(USE_Z3_MIN, Z3_MIN, Z3_MAX));
#endif
#if USE_Z4_MIN || USE_Z4_MAX
endstopz4_sta = !ESTATE(TERN(USE_Z4_MIN, Z4_MIN, Z4_MAX));
#endif
} }
#include "../../../libs/buzzer.h" #include "../../../libs/buzzer.h"
@ -185,7 +237,7 @@
else else
disp_det_error(); disp_det_error();
if (endstopx1_sta && endstopy1_sta && endstopz1_sta && endstopz2_sta) if (endstopx1_min && endstopx1_max && endstopy1_sta && endstopz1_min && endstopz1_max && endstopz2_sta && endstopz3_sta && endstopz4_sta)
disp_Limit_ok(); disp_Limit_ok();
else else
disp_Limit_error(); disp_Limit_error();
@ -247,7 +299,9 @@
#endif #endif
} }
if (endstopx1_sta && endstopx2_sta && endstopy1_sta && endstopy2_sta && endstopz1_sta && endstopz2_sta) { if ( endstopx1_min && endstopx1_max && endstopx2_sta && endstopy1_sta && endstopy2_sta
&& endstopz1_min && endstopz1_max && endstopz2_sta && endstopz3_sta && endstopz4_sta
) {
// nothing here // nothing here
} }
else { else {

View file

@ -102,9 +102,10 @@ void menu_advanced_settings();
#if ENABLED(LCD_ENDSTOP_TEST) #if ENABLED(LCD_ENDSTOP_TEST)
#define __STOP_ITEM(F,S) PSTRING_ITEM_F_P(F, TEST(stops, S) ? PSTR(STR_ENDSTOP_HIT) : PSTR(STR_ENDSTOP_OPEN), SS_FULL) #define __STOP_ITEM(F,S) PSTRING_ITEM_F_P(F, TEST(stops, S) ? PSTR(STR_ENDSTOP_HIT) : PSTR(STR_ENDSTOP_OPEN), SS_FULL);
#define _STOP_ITEM(L,S) __STOP_ITEM(F(L), S) #define _STOP_ITEM(L,S) __STOP_ITEM(F(L), S)
#define STOP_ITEM(A,I) _STOP_ITEM(STRINGIFY(A) STRINGIFY(I) " " TERN(A##_HOME_TO_MAX, "Max", "Min"), A##I##_ENDSTOP) #define STOP_ITEM(A,I,M,L) TERN(HAS_##A##I##_##M_STATE, _STOP_ITEM, _IF_1_ELSE)(STRINGIFY(A) STRINGIFY(I) " " STRINGIFY(L), A##I##_##M)
#define STOP_MINMAX(A,I) STOP_ITEM(A,,MIN,"Min") STOP_ITEM(A,,MAX,"Max")
#define FIL_ITEM(N) PSTRING_ITEM_N_P(N-1, MSG_FILAMENT_EN, (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) ? PSTR("PRESENT") : PSTR("out"), SS_FULL); #define FIL_ITEM(N) PSTRING_ITEM_N_P(N-1, MSG_FILAMENT_EN, (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) ? PSTR("PRESENT") : PSTR("out"), SS_FULL);
static void endstop_test() { static void endstop_test() {
@ -120,48 +121,12 @@ void menu_advanced_settings();
START_SCREEN(); START_SCREEN();
STATIC_ITEM_F(GET_TEXT_F(MSG_ENDSTOP_TEST), SS_DEFAULT|SS_INVERT); STATIC_ITEM_F(GET_TEXT_F(MSG_ENDSTOP_TEST), SS_DEFAULT|SS_INVERT);
#if HAS_X_ENDSTOP STOP_MINMAX(X,) STOP_MINMAX(X,2)
STOP_ITEM(X,); STOP_MINMAX(Y,) STOP_MINMAX(Y,2)
#if ENABLED(X_DUAL_ENDSTOPS) STOP_MINMAX(Z,) STOP_MINMAX(Z,2) STOP_MINMAX(Z,3) STOP_MINMAX(Z,4)
STOP_ITEM(X,2); STOP_MINMAX(I,) STOP_MINMAX(J,) STOP_MINMAX(K,)
#endif STOP_MINMAX(U,) STOP_MINMAX(V,) STOP_MINMAX(W,)
#endif
#if HAS_Y_ENDSTOP
STOP_ITEM(Y,);
#if ENABLED(Y_DUAL_ENDSTOPS)
STOP_ITEM(Y,2);
#endif
#endif
#if HAS_Z_ENDSTOP
STOP_ITEM(Z,);
#if ENABLED(Z_MULTI_ENDSTOPS)
STOP_ITEM(Z,2);
#if NUM_Z_STEPPERS >= 3
STOP_ITEM(Z,3);
#if NUM_Z_STEPPERS >= 4
STOP_ITEM(Z,4);
#endif
#endif
#endif
#endif
#if HAS_I_ENDSTOP
STOP_ITEM(I,);
#endif
#if HAS_J_ENDSTOP
STOP_ITEM(J,);
#endif
#if HAS_K_ENDSTOP
STOP_ITEM(K,);
#endif
#if HAS_U_ENDSTOP
STOP_ITEM(U,);
#endif
#if HAS_V_ENDSTOP
STOP_ITEM(V,);
#endif
#if HAS_W_ENDSTOP
STOP_ITEM(W,);
#endif
#if HAS_BED_PROBE && !HAS_DELTA_SENSORLESS_PROBING #if HAS_BED_PROBE && !HAS_DELTA_SENSORLESS_PROBING
__STOP_ITEM(GET_TEXT_F(MSG_Z_PROBE), Z_MIN_PROBE); __STOP_ITEM(GET_TEXT_F(MSG_Z_PROBE), Z_MIN_PROBE);
#endif #endif

View file

@ -138,7 +138,7 @@ void Endstops::init() {
#if USE_Y2_MAX #if USE_Y2_MAX
_INIT_ENDSTOP(MAX,Y,2); _INIT_ENDSTOP(MAX,Y,2);
#endif #endif
#if HAS_Z_MIN_PIN #if USE_Z_MIN
_INIT_ENDSTOP(MIN,Z,); _INIT_ENDSTOP(MIN,Z,);
#endif #endif
#if USE_Z_MAX #if USE_Z_MAX
@ -315,7 +315,7 @@ void Endstops::event_handler() {
SERIAL_ECHOPGM(" " STRINGIFY(A) ":", planner.triggered_position_mm(_AXIS(A))); _SET_STOP_CHAR(A,C); }while(0) SERIAL_ECHOPGM(" " STRINGIFY(A) ":", planner.triggered_position_mm(_AXIS(A))); _SET_STOP_CHAR(A,C); }while(0)
#define _ENDSTOP_HIT_TEST(A,C) \ #define _ENDSTOP_HIT_TEST(A,C) \
if (TERN0(USE_##A##_MIN, TEST(hit_state, ES_ENUM(A,MIN))) || TERN0(USE_##A##_MAX, TEST(hit_state, ES_ENUM(A,MAX)))) \ if (TERN0(HAS_##A##_MIN_STATE, TEST(hit_state, ES_ENUM(A,MIN))) || TERN0(HAS_##A##_MAX_STATE, TEST(hit_state, ES_ENUM(A,MAX)))) \
_ENDSTOP_HIT_ECHO(A,C) _ENDSTOP_HIT_ECHO(A,C)
#define ENDSTOP_HIT_TEST_X() _ENDSTOP_HIT_TEST(X,'X') #define ENDSTOP_HIT_TEST_X() _ENDSTOP_HIT_TEST(X,'X')
@ -504,11 +504,6 @@ void __O2 Endstops::report_states() {
} // Endstops::report_states } // Endstops::report_states
#define __ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
#define _ENDSTOP_HIT_STATE(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_HIT_STATE
#define _ENDSTOP(AXIS, MINMAX) __ENDSTOP(AXIS, MINMAX)
/** /**
* Called from interrupt context by the Endstop ISR or Stepper ISR! * Called from interrupt context by the Endstop ISR or Stepper ISR!
* Read endstops to get their current states, register hits for all * Read endstops to get their current states, register hits for all
@ -521,7 +516,9 @@ void Endstops::update() {
#endif #endif
// Macros to update / copy the live_state // Macros to update / copy the live_state
#define UPDATE_LIVE_STATE(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ_ENDSTOP(_ENDSTOP_PIN(AXIS, MINMAX)) == _ENDSTOP_HIT_STATE(AXIS, MINMAX))) #define _ES_PIN(A,M) A##_##M##_PIN
#define _ES_HIT(A,M) A##_##M##_ENDSTOP_HIT_STATE
#define UPDATE_LIVE_STATE(AXIS, MINMAX) SET_BIT_TO(live_state, ES_ENUM(AXIS, MINMAX), (READ_ENDSTOP(_ES_PIN(AXIS, MINMAX)) == _ES_HIT(AXIS, MINMAX)))
#define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT)) #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT))
#if ENABLED(G38_PROBE_TARGET) #if ENABLED(G38_PROBE_TARGET)
@ -560,7 +557,7 @@ void Endstops::update() {
/** /**
* Check and update endstops * Check and update endstops
*/ */
#if USE_X_MIN && !X_SPI_SENSORLESS #if USE_X_MIN
UPDATE_LIVE_STATE(X, MIN); UPDATE_LIVE_STATE(X, MIN);
#if ENABLED(X_DUAL_ENDSTOPS) #if ENABLED(X_DUAL_ENDSTOPS)
#if USE_X2_MIN #if USE_X2_MIN
@ -571,7 +568,7 @@ void Endstops::update() {
#endif #endif
#endif #endif
#if USE_X_MAX && !X_SPI_SENSORLESS #if USE_X_MAX
UPDATE_LIVE_STATE(X, MAX); UPDATE_LIVE_STATE(X, MAX);
#if ENABLED(X_DUAL_ENDSTOPS) #if ENABLED(X_DUAL_ENDSTOPS)
#if USE_X2_MAX #if USE_X2_MAX
@ -582,7 +579,7 @@ void Endstops::update() {
#endif #endif
#endif #endif
#if USE_Y_MIN && !Y_SPI_SENSORLESS #if USE_Y_MIN
UPDATE_LIVE_STATE(Y, MIN); UPDATE_LIVE_STATE(Y, MIN);
#if ENABLED(Y_DUAL_ENDSTOPS) #if ENABLED(Y_DUAL_ENDSTOPS)
#if USE_Y2_MIN #if USE_Y2_MIN
@ -593,7 +590,7 @@ void Endstops::update() {
#endif #endif
#endif #endif
#if USE_Y_MAX && !Y_SPI_SENSORLESS #if USE_Y_MAX
UPDATE_LIVE_STATE(Y, MAX); UPDATE_LIVE_STATE(Y, MAX);
#if ENABLED(Y_DUAL_ENDSTOPS) #if ENABLED(Y_DUAL_ENDSTOPS)
#if USE_Y2_MAX #if USE_Y2_MAX
@ -605,159 +602,84 @@ void Endstops::update() {
#endif #endif
#if USE_Z_MIN && NONE(Z_SPI_SENSORLESS, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) #if USE_Z_MIN && NONE(Z_SPI_SENSORLESS, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if HAS_Z_MIN_PIN UPDATE_LIVE_STATE(Z, MIN);
UPDATE_LIVE_STATE(Z, MIN); #endif
#endif #if USE_Z2_MIN
#if ENABLED(Z_MULTI_ENDSTOPS) UPDATE_LIVE_STATE(Z2, MIN);
#if USE_Z2_MIN #elif HAS_Z2_MIN_STATE
UPDATE_LIVE_STATE(Z2, MIN); COPY_LIVE_STATE(Z_MIN, Z2_MIN);
#else #endif
COPY_LIVE_STATE(Z_MIN, Z2_MIN); #if USE_Z3_MIN
#endif UPDATE_LIVE_STATE(Z3, MIN);
#if NUM_Z_STEPPERS >= 3 #elif HAS_Z3_MIN_STATE
#if USE_Z3_MIN COPY_LIVE_STATE(Z_MIN, Z3_MIN);
UPDATE_LIVE_STATE(Z3, MIN); #endif
#else #if USE_Z4_MIN
COPY_LIVE_STATE(Z_MIN, Z3_MIN); UPDATE_LIVE_STATE(Z4, MIN);
#endif #elif HAS_Z4_MIN_STATE
#endif COPY_LIVE_STATE(Z_MIN, Z4_MIN);
#if NUM_Z_STEPPERS >= 4
#if USE_Z4_MIN
UPDATE_LIVE_STATE(Z4, MIN);
#else
COPY_LIVE_STATE(Z_MIN, Z4_MIN);
#endif
#endif
#endif
#endif #endif
#if HAS_BED_PROBE #if HAS_REAL_BED_PROBE
// When closing the gap check the enabled probe // When closing the gap check the enabled probe
if (probe_switch_activated()) if (probe_switch_activated())
UPDATE_LIVE_STATE(Z, TERN(USE_Z_MIN_PROBE, MIN_PROBE, MIN)); UPDATE_LIVE_STATE(Z, TERN(USE_Z_MIN_PROBE, MIN_PROBE, MIN));
#endif #endif
#if USE_Z_MAX && !Z_SPI_SENSORLESS #if USE_Z_MAX
// Check both Z dual endstops UPDATE_LIVE_STATE(Z, MAX);
#if ENABLED(Z_MULTI_ENDSTOPS) #endif
UPDATE_LIVE_STATE(Z, MAX); #if USE_Z2_MAX
#if USE_Z2_MAX UPDATE_LIVE_STATE(Z2, MAX);
UPDATE_LIVE_STATE(Z2, MAX); #elif HAS_Z2_MAX_STATE
#else COPY_LIVE_STATE(Z_MAX, Z2_MAX);
COPY_LIVE_STATE(Z_MAX, Z2_MAX); #endif
#endif #if USE_Z3_MAX
#if NUM_Z_STEPPERS >= 3 UPDATE_LIVE_STATE(Z3, MAX);
#if USE_Z3_MAX #elif HAS_Z3_MAX_STATE
UPDATE_LIVE_STATE(Z3, MAX); COPY_LIVE_STATE(Z_MAX, Z3_MAX);
#else #endif
COPY_LIVE_STATE(Z_MAX, Z3_MAX); #if USE_Z4_MAX
#endif UPDATE_LIVE_STATE(Z4, MAX);
#endif #elif HAS_Z4_MAX_STATE
#if NUM_Z_STEPPERS >= 4 COPY_LIVE_STATE(Z_MAX, Z4_MAX);
#if USE_Z4_MAX
UPDATE_LIVE_STATE(Z4, MAX);
#else
COPY_LIVE_STATE(Z_MAX, Z4_MAX);
#endif
#endif
#elif TERN1(USE_Z_MIN_PROBE, Z_MAX_PIN != Z_MIN_PROBE_PIN)
// If this pin isn't the bed probe it's the Z endstop
UPDATE_LIVE_STATE(Z, MAX);
#endif
#endif #endif
#if USE_I_MIN && !I_SPI_SENSORLESS #if USE_I_MIN
#if ENABLED(I_DUAL_ENDSTOPS) UPDATE_LIVE_STATE(I, MIN);
UPDATE_LIVE_STATE(I, MIN);
#else
UPDATE_LIVE_STATE(I, MIN);
#endif
#endif #endif
#if USE_I_MAX
#if USE_I_MAX && !I_SPI_SENSORLESS UPDATE_LIVE_STATE(I, MAX);
#if ENABLED(I_DUAL_ENDSTOPS)
UPDATE_LIVE_STATE(I, MAX);
#else
UPDATE_LIVE_STATE(I, MAX);
#endif
#endif #endif
#if USE_J_MIN
#if USE_J_MIN && !J_SPI_SENSORLESS UPDATE_LIVE_STATE(J, MIN);
#if ENABLED(J_DUAL_ENDSTOPS)
UPDATE_LIVE_STATE(J, MIN);
#else
UPDATE_LIVE_STATE(J, MIN);
#endif
#endif #endif
#if USE_J_MAX
#if USE_J_MAX && !J_SPI_SENSORLESS UPDATE_LIVE_STATE(J, MAX);
#if ENABLED(J_DUAL_ENDSTOPS)
UPDATE_LIVE_STATE(J, MAX);
#else
UPDATE_LIVE_STATE(J, MAX);
#endif
#endif #endif
#if USE_K_MIN
#if USE_K_MIN && !K_SPI_SENSORLESS UPDATE_LIVE_STATE(K, MIN);
#if ENABLED(K_DUAL_ENDSTOPS)
UPDATE_LIVE_STATE(K, MIN);
#else
UPDATE_LIVE_STATE(K, MIN);
#endif
#endif #endif
#if USE_K_MAX
#if USE_K_MAX && !K_SPI_SENSORLESS UPDATE_LIVE_STATE(K, MAX);
#if ENABLED(K_DUAL_ENDSTOPS)
UPDATE_LIVE_STATE(K, MAX);
#else
UPDATE_LIVE_STATE(K, MAX);
#endif
#endif #endif
#if USE_U_MIN
#if USE_U_MIN && !U_SPI_SENSORLESS UPDATE_LIVE_STATE(U, MIN);
#if ENABLED(U_DUAL_ENDSTOPS)
UPDATE_LIVE_STATE(U, MIN);
#else
UPDATE_LIVE_STATE(U, MIN);
#endif
#endif #endif
#if USE_U_MAX
#if USE_U_MAX && !U_SPI_SENSORLESS UPDATE_LIVE_STATE(U, MAX);
#if ENABLED(U_DUAL_ENDSTOPS)
UPDATE_LIVE_STATE(U, MAX);
#else
UPDATE_LIVE_STATE(U, MAX);
#endif
#endif #endif
#if USE_V_MIN
#if USE_V_MIN && !V_SPI_SENSORLESS UPDATE_LIVE_STATE(V, MIN);
#if ENABLED(V_DUAL_ENDSTOPS)
UPDATE_LIVE_STATE(V, MIN);
#else
UPDATE_LIVE_STATE(V, MIN);
#endif
#endif #endif
#if USE_V_MAX && !V_SPI_SENSORLESS #if USE_V_MAX
#if ENABLED(O_DUAL_ENDSTOPS) UPDATE_LIVE_STATE(V, MAX);
UPDATE_LIVE_STATE(V, MAX);
#else
UPDATE_LIVE_STATE(V, MAX);
#endif
#endif #endif
#if USE_W_MIN
#if USE_W_MIN && !W_SPI_SENSORLESS UPDATE_LIVE_STATE(W, MIN);
#if ENABLED(W_DUAL_ENDSTOPS)
UPDATE_LIVE_STATE(W, MIN);
#else
UPDATE_LIVE_STATE(W, MIN);
#endif
#endif #endif
#if USE_W_MAX && !W_SPI_SENSORLESS #if USE_W_MAX
#if ENABLED(W_DUAL_ENDSTOPS) UPDATE_LIVE_STATE(W, MAX);
UPDATE_LIVE_STATE(W, MAX);
#else
UPDATE_LIVE_STATE(W, MAX);
#endif
#endif #endif
#if ENDSTOP_NOISE_THRESHOLD #if ENDSTOP_NOISE_THRESHOLD
@ -788,11 +710,11 @@ void Endstops::update() {
#define TEST_ENDSTOP(ENDSTOP) (TEST(state(), ENDSTOP)) #define TEST_ENDSTOP(ENDSTOP) (TEST(state(), ENDSTOP))
// Record endstop was hit // Record endstop was hit
#define _ENDSTOP_HIT(AXIS, MINMAX) SBI(hit_state, _ENDSTOP(AXIS, MINMAX)) #define _ENDSTOP_HIT(AXIS, MINMAX) SBI(hit_state, ES_ENUM(AXIS, MINMAX))
// Call the endstop triggered routine for single endstops // Call the endstop triggered routine for single endstops
#define PROCESS_ENDSTOP(AXIS, MINMAX) do { \ #define PROCESS_ENDSTOP(AXIS, MINMAX) do { \
if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX))) { \ if (TEST_ENDSTOP(ES_ENUM(AXIS, MINMAX))) { \
_ENDSTOP_HIT(AXIS, MINMAX); \ _ENDSTOP_HIT(AXIS, MINMAX); \
planner.endstop_triggered(_AXIS(AXIS)); \ planner.endstop_triggered(_AXIS(AXIS)); \
} \ } \
@ -801,7 +723,7 @@ void Endstops::update() {
// Core Sensorless Homing needs to test an Extra Pin // Core Sensorless Homing needs to test an Extra Pin
#define CORE_DIAG(QQ,A,MM) (CORE_IS_##QQ && A##_SENSORLESS && !A##_SPI_SENSORLESS && USE_##A##_##MM) #define CORE_DIAG(QQ,A,MM) (CORE_IS_##QQ && A##_SENSORLESS && !A##_SPI_SENSORLESS && USE_##A##_##MM)
#define PROCESS_CORE_ENDSTOP(A1,M1,A2,M2) do { \ #define PROCESS_CORE_ENDSTOP(A1,M1,A2,M2) do { \
if (TEST_ENDSTOP(_ENDSTOP(A1,M1))) { \ if (TEST_ENDSTOP(ES_ENUM(A1,M1))) { \
_ENDSTOP_HIT(A2,M2); \ _ENDSTOP_HIT(A2,M2); \
planner.endstop_triggered(_AXIS(A2)); \ planner.endstop_triggered(_AXIS(A2)); \
} \ } \
@ -809,7 +731,7 @@ void Endstops::update() {
// Call the endstop triggered routine for dual endstops // Call the endstop triggered routine for dual endstops
#define PROCESS_DUAL_ENDSTOP(A, MINMAX) do { \ #define PROCESS_DUAL_ENDSTOP(A, MINMAX) do { \
const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(A, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(A##2, MINMAX)) << 1); \ const byte dual_hit = TEST_ENDSTOP(ES_ENUM(A, MINMAX)) | (TEST_ENDSTOP(ES_ENUM(A##2, MINMAX)) << 1); \
if (dual_hit) { \ if (dual_hit) { \
_ENDSTOP_HIT(A, MINMAX); \ _ENDSTOP_HIT(A, MINMAX); \
/* if not performing home or if both endstops were triggered during homing... */ \ /* if not performing home or if both endstops were triggered during homing... */ \
@ -819,7 +741,7 @@ void Endstops::update() {
}while(0) }while(0)
#define PROCESS_TRIPLE_ENDSTOP(A, MINMAX) do { \ #define PROCESS_TRIPLE_ENDSTOP(A, MINMAX) do { \
const byte triple_hit = TEST_ENDSTOP(_ENDSTOP(A, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(A##2, MINMAX)) << 1) | (TEST_ENDSTOP(_ENDSTOP(A##3, MINMAX)) << 2); \ const byte triple_hit = TEST_ENDSTOP(ES_ENUM(A, MINMAX)) | (TEST_ENDSTOP(ES_ENUM(A##2, MINMAX)) << 1) | (TEST_ENDSTOP(ES_ENUM(A##3, MINMAX)) << 2); \
if (triple_hit) { \ if (triple_hit) { \
_ENDSTOP_HIT(A, MINMAX); \ _ENDSTOP_HIT(A, MINMAX); \
/* if not performing home or if both endstops were triggered during homing... */ \ /* if not performing home or if both endstops were triggered during homing... */ \
@ -829,7 +751,7 @@ void Endstops::update() {
}while(0) }while(0)
#define PROCESS_QUAD_ENDSTOP(A, MINMAX) do { \ #define PROCESS_QUAD_ENDSTOP(A, MINMAX) do { \
const byte quad_hit = TEST_ENDSTOP(_ENDSTOP(A, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(A##2, MINMAX)) << 1) | (TEST_ENDSTOP(_ENDSTOP(A##3, MINMAX)) << 2) | (TEST_ENDSTOP(_ENDSTOP(A##4, MINMAX)) << 3); \ const byte quad_hit = TEST_ENDSTOP(ES_ENUM(A, MINMAX)) | (TEST_ENDSTOP(ES_ENUM(A##2, MINMAX)) << 1) | (TEST_ENDSTOP(ES_ENUM(A##3, MINMAX)) << 2) | (TEST_ENDSTOP(ES_ENUM(A##4, MINMAX)) << 3); \
if (quad_hit) { \ if (quad_hit) { \
_ENDSTOP_HIT(A, MINMAX); \ _ENDSTOP_HIT(A, MINMAX); \
/* if not performing home or if both endstops were triggered during homing... */ \ /* if not performing home or if both endstops were triggered during homing... */ \
@ -876,7 +798,7 @@ void Endstops::update() {
#if HAS_X_AXIS #if HAS_X_AXIS
if (stepper.axis_is_moving(X_AXIS)) { if (stepper.axis_is_moving(X_AXIS)) {
if (!stepper.motor_direction(X_AXIS_HEAD)) { // -direction if (!stepper.motor_direction(X_AXIS_HEAD)) { // -direction
#if USE_X_MIN || (X_SPI_SENSORLESS && X_HOME_TO_MIN) #if HAS_X_MIN_STATE
PROCESS_ENDSTOP_X(MIN); PROCESS_ENDSTOP_X(MIN);
#if CORE_DIAG(XY, Y, MIN) #if CORE_DIAG(XY, Y, MIN)
PROCESS_CORE_ENDSTOP(Y,MIN,X,MIN); PROCESS_CORE_ENDSTOP(Y,MIN,X,MIN);
@ -890,7 +812,7 @@ void Endstops::update() {
#endif #endif
} }
else { // +direction else { // +direction
#if USE_X_MAX || (X_SPI_SENSORLESS && X_HOME_TO_MAX) #if HAS_X_MAX_STATE
PROCESS_ENDSTOP_X(MAX); PROCESS_ENDSTOP_X(MAX);
#if CORE_DIAG(XY, Y, MIN) #if CORE_DIAG(XY, Y, MIN)
PROCESS_CORE_ENDSTOP(Y,MIN,X,MAX); PROCESS_CORE_ENDSTOP(Y,MIN,X,MAX);
@ -909,7 +831,7 @@ void Endstops::update() {
#if HAS_Y_AXIS #if HAS_Y_AXIS
if (stepper.axis_is_moving(Y_AXIS)) { if (stepper.axis_is_moving(Y_AXIS)) {
if (!stepper.motor_direction(Y_AXIS_HEAD)) { // -direction if (!stepper.motor_direction(Y_AXIS_HEAD)) { // -direction
#if USE_Y_MIN || (Y_SPI_SENSORLESS && Y_HOME_TO_MIN) #if HAS_Y_MIN_STATE
PROCESS_ENDSTOP_Y(MIN); PROCESS_ENDSTOP_Y(MIN);
#if CORE_DIAG(XY, X, MIN) #if CORE_DIAG(XY, X, MIN)
PROCESS_CORE_ENDSTOP(X,MIN,Y,MIN); PROCESS_CORE_ENDSTOP(X,MIN,Y,MIN);
@ -923,7 +845,7 @@ void Endstops::update() {
#endif #endif
} }
else { // +direction else { // +direction
#if USE_Y_MAX || (Y_SPI_SENSORLESS && Y_HOME_TO_MAX) #if HAS_Y_MAX_STATE
PROCESS_ENDSTOP_Y(MAX); PROCESS_ENDSTOP_Y(MAX);
#if CORE_DIAG(XY, X, MIN) #if CORE_DIAG(XY, X, MIN)
PROCESS_CORE_ENDSTOP(X,MIN,Y,MAX); PROCESS_CORE_ENDSTOP(X,MIN,Y,MAX);
@ -942,34 +864,34 @@ void Endstops::update() {
#if HAS_Z_AXIS #if HAS_Z_AXIS
if (stepper.axis_is_moving(Z_AXIS)) { if (stepper.axis_is_moving(Z_AXIS)) {
if (!stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up. if (!stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up.
#if HAS_Z_MIN_STATE
#if USE_Z_MIN || (Z_SPI_SENSORLESS && Z_HOME_TO_MIN) // If the Z_MIN_PIN is being used for the probe there's no
if ( TERN1(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, z_probe_enabled) // separate Z_MIN endstop. But a Z endstop could be wired
&& TERN1(USE_Z_MIN_PROBE, !z_probe_enabled) // in series, so someone might find this useful.
) PROCESS_ENDSTOP_Z(MIN); if ( TERN1(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, z_probe_enabled) // When Z_MIN is the probe, the probe must be enabled
#if CORE_DIAG(XZ, X, MIN) && TERN1(USE_Z_MIN_PROBE, !z_probe_enabled) // When Z_MIN isn't the probe, Z MIN is ignored while probing
PROCESS_CORE_ENDSTOP(X,MIN,Z,MIN); ) {
#elif CORE_DIAG(XZ, X, MAX) PROCESS_ENDSTOP_Z(MIN);
PROCESS_CORE_ENDSTOP(X,MAX,Z,MIN); #if CORE_DIAG(XZ, X, MIN)
#elif CORE_DIAG(YZ, Y, MIN) PROCESS_CORE_ENDSTOP(X,MIN,Z,MIN);
PROCESS_CORE_ENDSTOP(Y,MIN,Z,MIN); #elif CORE_DIAG(XZ, X, MAX)
#elif CORE_DIAG(YZ, Y, MAX) PROCESS_CORE_ENDSTOP(X,MAX,Z,MIN);
PROCESS_CORE_ENDSTOP(Y,MAX,Z,MIN); #elif CORE_DIAG(YZ, Y, MIN)
#endif PROCESS_CORE_ENDSTOP(Y,MIN,Z,MIN);
#elif CORE_DIAG(YZ, Y, MAX)
PROCESS_CORE_ENDSTOP(Y,MAX,Z,MIN);
#endif
}
#endif #endif
// When closing the gap check the enabled probe // When closing the gap use the probe trigger state
#if USE_Z_MIN_PROBE #if USE_Z_MIN_PROBE
if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE); if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE);
#endif #endif
} }
else { // Z +direction. Gantry up, bed down. else { // Z +direction. Gantry up, bed down.
#if USE_Z_MAX || (Z_SPI_SENSORLESS && Z_HOME_TO_MAX) #if HAS_Z_MAX_STATE
#if ENABLED(Z_MULTI_ENDSTOPS) PROCESS_ENDSTOP_Z(MAX);
PROCESS_ENDSTOP_Z(MAX);
#elif TERN1(USE_Z_MIN_PROBE, Z_MAX_PIN != Z_MIN_PROBE_PIN) // No probe or probe is Z_MIN || Probe is not Z_MAX
PROCESS_ENDSTOP(Z, MAX);
#endif
#if CORE_DIAG(XZ, X, MIN) #if CORE_DIAG(XZ, X, MIN)
PROCESS_CORE_ENDSTOP(X,MIN,Z,MAX); PROCESS_CORE_ENDSTOP(X,MIN,Z,MAX);
#elif CORE_DIAG(XZ, X, MAX) #elif CORE_DIAG(XZ, X, MAX)
@ -987,12 +909,12 @@ void Endstops::update() {
#if HAS_I_AXIS #if HAS_I_AXIS
if (stepper.axis_is_moving(I_AXIS)) { if (stepper.axis_is_moving(I_AXIS)) {
if (!stepper.motor_direction(I_AXIS_HEAD)) { // -direction if (!stepper.motor_direction(I_AXIS_HEAD)) { // -direction
#if USE_I_MIN || (I_SPI_SENSORLESS && I_HOME_TO_MIN) #if HAS_I_MIN_STATE
PROCESS_ENDSTOP(I, MIN); PROCESS_ENDSTOP(I, MIN);
#endif #endif
} }
else { // +direction else { // +direction
#if USE_I_MAX || (I_SPI_SENSORLESS && I_HOME_TO_MAX) #if HAS_I_MAX_STATE
PROCESS_ENDSTOP(I, MAX); PROCESS_ENDSTOP(I, MAX);
#endif #endif
} }
@ -1002,12 +924,12 @@ void Endstops::update() {
#if HAS_J_AXIS #if HAS_J_AXIS
if (stepper.axis_is_moving(J_AXIS)) { if (stepper.axis_is_moving(J_AXIS)) {
if (!stepper.motor_direction(J_AXIS_HEAD)) { // -direction if (!stepper.motor_direction(J_AXIS_HEAD)) { // -direction
#if USE_J_MIN || (J_SPI_SENSORLESS && J_HOME_TO_MIN) #if HAS_J_MIN_STATE
PROCESS_ENDSTOP(J, MIN); PROCESS_ENDSTOP(J, MIN);
#endif #endif
} }
else { // +direction else { // +direction
#if USE_J_MAX || (J_SPI_SENSORLESS && J_HOME_TO_MAX) #if HAS_J_MAX_STATE
PROCESS_ENDSTOP(J, MAX); PROCESS_ENDSTOP(J, MAX);
#endif #endif
} }
@ -1017,12 +939,12 @@ void Endstops::update() {
#if HAS_K_AXIS #if HAS_K_AXIS
if (stepper.axis_is_moving(K_AXIS)) { if (stepper.axis_is_moving(K_AXIS)) {
if (!stepper.motor_direction(K_AXIS_HEAD)) { // -direction if (!stepper.motor_direction(K_AXIS_HEAD)) { // -direction
#if USE_K_MIN || (K_SPI_SENSORLESS && K_HOME_TO_MIN) #if HAS_K_MIN_STATE
PROCESS_ENDSTOP(K, MIN); PROCESS_ENDSTOP(K, MIN);
#endif #endif
} }
else { // +direction else { // +direction
#if USE_K_MAX || (K_SPI_SENSORLESS && K_HOME_TO_MAX) #if HAS_K_MAX_STATE
PROCESS_ENDSTOP(K, MAX); PROCESS_ENDSTOP(K, MAX);
#endif #endif
} }
@ -1032,12 +954,12 @@ void Endstops::update() {
#if HAS_U_AXIS #if HAS_U_AXIS
if (stepper.axis_is_moving(U_AXIS)) { if (stepper.axis_is_moving(U_AXIS)) {
if (!stepper.motor_direction(U_AXIS_HEAD)) { // -direction if (!stepper.motor_direction(U_AXIS_HEAD)) { // -direction
#if USE_U_MIN || (U_SPI_SENSORLESS && U_HOME_TO_MIN) #if HAS_U_MIN_STATE
PROCESS_ENDSTOP(U, MIN); PROCESS_ENDSTOP(U, MIN);
#endif #endif
} }
else { // +direction else { // +direction
#if USE_U_MAX || (U_SPI_SENSORLESS && U_HOME_TO_MAX) #if HAS_U_MAX_STATE
PROCESS_ENDSTOP(U, MAX); PROCESS_ENDSTOP(U, MAX);
#endif #endif
} }
@ -1047,12 +969,12 @@ void Endstops::update() {
#if HAS_V_AXIS #if HAS_V_AXIS
if (stepper.axis_is_moving(V_AXIS)) { if (stepper.axis_is_moving(V_AXIS)) {
if (!stepper.motor_direction(V_AXIS_HEAD)) { // -direction if (!stepper.motor_direction(V_AXIS_HEAD)) { // -direction
#if USE_V_MIN || (V_SPI_SENSORLESS && V_HOME_TO_MIN) #if HAS_V_MIN_STATE
PROCESS_ENDSTOP(V, MIN); PROCESS_ENDSTOP(V, MIN);
#endif #endif
} }
else { // +direction else { // +direction
#if USE_V_MAX || (V_SPI_SENSORLESS && V_HOME_TO_MAX) #if HAS_V_MAX_STATE
PROCESS_ENDSTOP(V, MAX); PROCESS_ENDSTOP(V, MAX);
#endif #endif
} }
@ -1062,17 +984,18 @@ void Endstops::update() {
#if HAS_W_AXIS #if HAS_W_AXIS
if (stepper.axis_is_moving(W_AXIS)) { if (stepper.axis_is_moving(W_AXIS)) {
if (!stepper.motor_direction(W_AXIS_HEAD)) { // -direction if (!stepper.motor_direction(W_AXIS_HEAD)) { // -direction
#if USE_W_MIN || (W_SPI_SENSORLESS && W_HOME_TO_MIN) #if HAS_W_MIN_STATE
PROCESS_ENDSTOP(W, MIN); PROCESS_ENDSTOP(W, MIN);
#endif #endif
} }
else { // +direction else { // +direction
#if USE_W_MAX || (W_SPI_SENSORLESS && W_HOME_TO_MAX) #if HAS_W_MAX_STATE
PROCESS_ENDSTOP(W, MAX); PROCESS_ENDSTOP(W, MAX);
#endif #endif
} }
} }
#endif // HAS_W_AXIS #endif // HAS_W_AXIS
} // Endstops::update() } // Endstops::update()
#if ENABLED(SPI_ENDSTOPS) #if ENABLED(SPI_ENDSTOPS)
@ -1080,39 +1003,67 @@ void Endstops::update() {
// Called from idle() to read Trinamic stall states // Called from idle() to read Trinamic stall states
bool Endstops::tmc_spi_homing_check() { bool Endstops::tmc_spi_homing_check() {
bool hit = false; bool hit = false;
#if X_SPI_SENSORLESS #if X_SPI_SENSORLESS
if (tmc_spi_homing.x && (stepperX.test_stall_status() if (tmc_spi_homing.x) {
#if Y_SPI_SENSORLESS && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) #if ENABLED(DUAL_X_CARRIAGE)
|| stepperY.test_stall_status() const bool ismin = X_MIN_TEST();
#elif Z_SPI_SENSORLESS && CORE_IS_XZ
|| stepperZ.test_stall_status()
#endif #endif
)) { SBI(live_state, X_ENDSTOP); hit = true; } const bool xhit = (
#if ENABLED(X_DUAL_ENDSTOPS) #if ENABLED(DUAL_X_CARRIAGE)
if (tmc_spi_homing.x && stepperX2.test_stall_status()) { SBI(live_state, X2_ENDSTOP); hit = true; } ismin ? stepperX.test_stall_status() : stepperX2.test_stall_status()
#endif #else
stepperX.test_stall_status()
#if Y_SPI_SENSORLESS && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
|| stepperY.test_stall_status()
#elif Z_SPI_SENSORLESS && CORE_IS_XZ
|| stepperZ.test_stall_status()
#endif
#endif
);
if (xhit) { SBI(live_state, TERN(DUAL_X_CARRIAGE, ismin ? X_MIN : X_MAX, X_ENDSTOP)); hit = true; }
#if ENABLED(X_DUAL_ENDSTOPS)
if (stepperX2.test_stall_status()) { SBI(live_state, X2_ENDSTOP); hit = true; }
#endif
}
#endif #endif
#if Y_SPI_SENSORLESS #if Y_SPI_SENSORLESS
if (tmc_spi_homing.y && (stepperY.test_stall_status() if (tmc_spi_homing.y) {
#if X_SPI_SENSORLESS && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) if (stepperY.test_stall_status()
|| stepperX.test_stall_status() #if X_SPI_SENSORLESS && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#elif Z_SPI_SENSORLESS && CORE_IS_YZ || stepperX.test_stall_status()
|| stepperZ.test_stall_status() #elif Z_SPI_SENSORLESS && CORE_IS_YZ
|| stepperZ.test_stall_status()
#endif
) { SBI(live_state, Y_ENDSTOP); hit = true; }
#if ENABLED(Y_DUAL_ENDSTOPS)
if (stepperY2.test_stall_status()) { SBI(live_state, Y2_ENDSTOP); hit = true; }
#endif #endif
)) { SBI(live_state, Y_ENDSTOP); hit = true; } }
#if ENABLED(Y_DUAL_ENDSTOPS)
if (tmc_spi_homing.y && stepperY2.test_stall_status()) { SBI(live_state, Y2_ENDSTOP); hit = true; }
#endif
#endif #endif
#if Z_SPI_SENSORLESS #if Z_SPI_SENSORLESS
if (tmc_spi_homing.z && (stepperZ.test_stall_status() if (tmc_spi_homing.z) {
#if X_SPI_SENSORLESS && CORE_IS_XZ if (stepperZ.test_stall_status()
|| stepperX.test_stall_status() #if X_SPI_SENSORLESS && CORE_IS_XZ
#elif Y_SPI_SENSORLESS && CORE_IS_YZ || stepperX.test_stall_status()
|| stepperY.test_stall_status() #elif Y_SPI_SENSORLESS && CORE_IS_YZ
|| stepperY.test_stall_status()
#endif
) { SBI(live_state, Z_ENDSTOP); hit = true; }
#if ENABLED(Z_MULTI_ENDSTOPS)
if (stepperZ2.test_stall_status()) { SBI(live_state, Z2_ENDSTOP); hit = true; }
#if NUM_Z_STEPPERS >= 3
if (stepperZ3.test_stall_status()) { SBI(live_state, Z3_ENDSTOP); hit = true; }
#if NUM_Z_STEPPERS >= 4
if (stepperZ4.test_stall_status()) { SBI(live_state, Z4_ENDSTOP); hit = true; }
#endif
#endif
#endif #endif
)) { SBI(live_state, Z_ENDSTOP); hit = true; } }
#endif #endif
#if I_SPI_SENSORLESS #if I_SPI_SENSORLESS
if (tmc_spi_homing.i && stepperI.test_stall_status()) { SBI(live_state, I_ENDSTOP); hit = true; } if (tmc_spi_homing.i && stepperI.test_stall_status()) { SBI(live_state, I_ENDSTOP); hit = true; }
#endif #endif
@ -1147,6 +1098,15 @@ void Endstops::update() {
CBI(live_state, Y2_ENDSTOP); CBI(live_state, Y2_ENDSTOP);
#endif #endif
TERN_(Z_SPI_SENSORLESS, CBI(live_state, Z_ENDSTOP)); TERN_(Z_SPI_SENSORLESS, CBI(live_state, Z_ENDSTOP));
#if ALL(Z_SPI_SENSORLESS, Z_MULTI_ENDSTOPS)
CBI(live_state, Z2_ENDSTOP);
#if NUM_Z_STEPPERS >= 3
CBI(live_state, Z3_ENDSTOP);
#if NUM_Z_STEPPERS >= 4
CBI(live_state, Z4_ENDSTOP);
#endif
#endif
#endif
TERN_(I_SPI_SENSORLESS, CBI(live_state, I_ENDSTOP)); TERN_(I_SPI_SENSORLESS, CBI(live_state, I_ENDSTOP));
TERN_(J_SPI_SENSORLESS, CBI(live_state, J_ENDSTOP)); TERN_(J_SPI_SENSORLESS, CBI(live_state, J_ENDSTOP));
TERN_(K_SPI_SENSORLESS, CBI(live_state, K_ENDSTOP)); TERN_(K_SPI_SENSORLESS, CBI(live_state, K_ENDSTOP));
@ -1190,7 +1150,7 @@ void Endstops::update() {
#if USE_Y_MAX #if USE_Y_MAX
ES_GET_STATE(Y_MAX); ES_GET_STATE(Y_MAX);
#endif #endif
#if HAS_Z_MIN_PIN #if USE_Z_MIN
ES_GET_STATE(Z_MIN); ES_GET_STATE(Z_MIN);
#endif #endif
#if USE_Z_MAX #if USE_Z_MAX
@ -1266,7 +1226,7 @@ void Endstops::update() {
ES_GET_STATE(W_MIN); ES_GET_STATE(W_MIN);
#endif #endif
uint16_t endstop_change = live_state_local ^ old_live_state_local; const uint16_t endstop_change = live_state_local ^ old_live_state_local;
#define ES_REPORT_CHANGE(S) if (TEST(endstop_change, S)) SERIAL_ECHOPGM(" " STRINGIFY(S) ":", TEST(live_state_local, S)) #define ES_REPORT_CHANGE(S) if (TEST(endstop_change, S)) SERIAL_ECHOPGM(" " STRINGIFY(S) ":", TEST(live_state_local, S))
if (endstop_change) { if (endstop_change) {
@ -1371,52 +1331,80 @@ void Endstops::update() {
/** /**
* Change TMC driver currents to N##_CURRENT_HOME, saving the current configuration of each. * Change TMC driver currents to N##_CURRENT_HOME, saving the current configuration of each.
*/ */
void Endstops::set_homing_current(const bool onoff) { void Endstops::set_z_sensorless_current(const bool onoff) {
#define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT) #if ENABLED(DELTA) && HAS_CURRENT_HOME(X)
#define HAS_DELTA_X_CURRENT (ENABLED(DELTA) && HAS_CURRENT_HOME(X)) #define HAS_DELTA_X_CURRENT 1
#define HAS_DELTA_Y_CURRENT (ENABLED(DELTA) && HAS_CURRENT_HOME(Y)) #endif
#if HAS_DELTA_X_CURRENT || HAS_DELTA_Y_CURRENT || HAS_CURRENT_HOME(Z) #if ENABLED(DELTA) && HAS_CURRENT_HOME(Y)
#define HAS_DELTA_Y_CURRENT 1
#endif
#if HAS_DELTA_X_CURRENT || HAS_DELTA_Y_CURRENT || HAS_CURRENT_HOME(Z) || HAS_CURRENT_HOME(Z2) || HAS_CURRENT_HOME(Z3) || HAS_CURRENT_HOME(Z4)
#if HAS_DELTA_X_CURRENT #if HAS_DELTA_X_CURRENT
static int16_t saved_current_x; static int16_t saved_current_X;
#endif #endif
#if HAS_DELTA_Y_CURRENT #if HAS_DELTA_Y_CURRENT
static int16_t saved_current_y; static int16_t saved_current_Y;
#endif #endif
#if HAS_CURRENT_HOME(Z) #if HAS_CURRENT_HOME(Z)
static int16_t saved_current_z; static int16_t saved_current_Z;
#endif #endif
auto debug_current_on = [](PGM_P const s, const int16_t a, const int16_t b) { #if HAS_CURRENT_HOME(Z2)
if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM_P(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); } static int16_t saved_current_Z2;
}; #endif
#if HAS_CURRENT_HOME(Z3)
static int16_t saved_current_Z3;
#endif
#if HAS_CURRENT_HOME(Z4)
static int16_t saved_current_Z4;
#endif
#if ENABLED(DEBUG_LEVELING_FEATURE)
auto debug_current = [](FSTR_P const s, const int16_t a, const int16_t b) {
if (DEBUGGING(LEVELING)) { DEBUG_ECHOF(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); }
};
#else
#define debug_current(...)
#endif
#define _SAVE_SET_CURRENT(A) \
saved_current_##A = stepper##A.getMilliamps(); \
stepper##A.rms_current(A##_CURRENT_HOME); \
debug_current(F(STR_##A), saved_current_##A, A##_CURRENT_HOME)
#define _RESTORE_CURRENT(A) \
stepper##A.rms_current(saved_current_##A); \
debug_current(F(STR_##A), saved_current_##A, A##_CURRENT_HOME)
if (onoff) { if (onoff) {
#if HAS_DELTA_X_CURRENT TERN_(HAS_DELTA_X_CURRENT, _SAVE_SET_CURRENT(X));
saved_current_x = stepperX.getMilliamps(); TERN_(HAS_DELTA_Y_CURRENT, _SAVE_SET_CURRENT(Y));
stepperX.rms_current(X_CURRENT_HOME);
debug_current_on(PSTR("X"), saved_current_x, X_CURRENT_HOME);
#endif
#if HAS_DELTA_Y_CURRENT
saved_current_y = stepperY.getMilliamps();
stepperY.rms_current(Y_CURRENT_HOME);
debug_current_on(PSTR("Y"), saved_current_y, Y_CURRENT_HOME);
#endif
#if HAS_CURRENT_HOME(Z) #if HAS_CURRENT_HOME(Z)
saved_current_z = stepperZ.getMilliamps(); _SAVE_SET_CURRENT(Z);
stepperZ.rms_current(Z_CURRENT_HOME); #endif
debug_current_on(PSTR("Z"), saved_current_z, Z_CURRENT_HOME); #if HAS_CURRENT_HOME(Z2)
_SAVE_SET_CURRENT(Z2);
#endif
#if HAS_CURRENT_HOME(Z3)
_SAVE_SET_CURRENT(Z3);
#endif
#if HAS_CURRENT_HOME(Z4)
_SAVE_SET_CURRENT(Z4);
#endif #endif
} }
else { else {
#if HAS_DELTA_X_CURRENT TERN_(HAS_DELTA_X_CURRENT, _RESTORE_CURRENT(X));
stepperX.rms_current(saved_current_x); TERN_(HAS_DELTA_Y_CURRENT, _RESTORE_CURRENT(Y));
debug_current_on(PSTR("X"), X_CURRENT_HOME, saved_current_x);
#endif
#if HAS_DELTA_Y_CURRENT
stepperY.rms_current(saved_current_y);
debug_current_on(PSTR("Y"), Y_CURRENT_HOME, saved_current_y);
#endif
#if HAS_CURRENT_HOME(Z) #if HAS_CURRENT_HOME(Z)
stepperZ.rms_current(saved_current_z); _RESTORE_CURRENT(Z);
debug_current_on(PSTR("Z"), Z_CURRENT_HOME, saved_current_z); #endif
#if HAS_CURRENT_HOME(Z2)
_RESTORE_CURRENT(Z2);
#endif
#if HAS_CURRENT_HOME(Z3)
_RESTORE_CURRENT(Z3);
#endif
#if HAS_CURRENT_HOME(Z4)
_RESTORE_CURRENT(Z4);
#endif #endif
} }

View file

@ -32,7 +32,12 @@
#define ES_ENUM(A,M) _ES_ENUM(A,M) #define ES_ENUM(A,M) _ES_ENUM(A,M)
#define _ES_ITEM(N) N, #define _ES_ITEM(N) N,
#define ES_ITEM(K,N) TERN_(K,DEFER4(_ES_ITEM)(N)) #define ES_ITEM(K,N) TERN(K,_ES_ITEM,_IF_1_ELSE)(N)
#define _ESN_ITEM(K,A,M) ES_ITEM(K,ES_ENUM(A,M))
#define ES_MINMAX(A) ES_ITEM(HAS_##A##_MIN_STATE, ES_ENUM(A,MIN)) ES_ITEM(HAS_##A##_MAX_STATE, ES_ENUM(A,MAX))
#define HAS_CURRENT_HOME(N) ((N##_CURRENT_HOME > 0) && (N##_CURRENT_HOME != N##_CURRENT))
/** /**
* Basic Endstop Flag Bits: * Basic Endstop Flag Bits:
@ -54,90 +59,71 @@
*/ */
enum EndstopEnum : char { enum EndstopEnum : char {
// Common XYZ (ABC) endstops. // Common XYZ (ABC) endstops.
ES_ITEM(USE_X_MIN, X_MIN) ES_ITEM(USE_X_MAX, X_MAX) ES_MINMAX(X) ES_MINMAX(Y) ES_MINMAX(Z)
ES_ITEM(USE_Y_MIN, Y_MIN) ES_ITEM(USE_Y_MAX, Y_MAX) ES_MINMAX(I) ES_MINMAX(J) ES_MINMAX(K)
ES_ITEM(USE_Z_MIN, Z_MIN) ES_ITEM(USE_Z_MAX, Z_MAX) ES_MINMAX(U) ES_MINMAX(V) ES_MINMAX(W)
ES_ITEM(USE_I_MIN, I_MIN) ES_ITEM(USE_I_MAX, I_MAX)
ES_ITEM(USE_J_MIN, J_MIN) ES_ITEM(USE_J_MAX, J_MAX)
ES_ITEM(USE_K_MIN, K_MIN) ES_ITEM(USE_K_MAX, K_MAX)
ES_ITEM(USE_U_MIN, U_MIN) ES_ITEM(USE_U_MAX, U_MAX)
ES_ITEM(USE_V_MIN, V_MIN) ES_ITEM(USE_V_MAX, V_MAX)
ES_ITEM(USE_W_MIN, W_MIN) ES_ITEM(USE_W_MAX, W_MAX)
// Extra Endstops for XYZ // Extra Endstops for XYZ
#if ENABLED(X_DUAL_ENDSTOPS) ES_MINMAX(X2) ES_MINMAX(Y2) ES_MINMAX(Z2) ES_MINMAX(Z3) ES_MINMAX(Z4)
ES_ITEM(USE_X_MIN, X2_MIN) ES_ITEM(USE_X_MAX, X2_MAX)
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
ES_ITEM(USE_Y_MIN, Y2_MIN) ES_ITEM(USE_Y_MAX, Y2_MAX)
#endif
#if ENABLED(Z_MULTI_ENDSTOPS)
ES_ITEM(USE_Z_MIN, Z2_MIN) ES_ITEM(USE_Z_MAX, Z2_MAX)
#if NUM_Z_STEPPERS >= 3
ES_ITEM(USE_Z_MIN, Z3_MIN) ES_ITEM(USE_Z_MAX, Z3_MAX)
#if NUM_Z_STEPPERS >= 4
ES_ITEM(USE_Z_MIN, Z4_MIN) ES_ITEM(USE_Z_MAX, Z4_MAX)
#endif
#endif
#endif
// Bed Probe state is distinct or shared with Z_MIN (i.e., when the probe is the only Z endstop) // Bed Probe state is distinct or shared with Z_MIN (i.e., when the probe is the only Z endstop)
#if !HAS_DELTA_SENSORLESS_PROBING ES_ITEM(HAS_Z_PROBE_STATE, Z_MIN_PROBE IF_DISABLED(USE_Z_MIN_PROBE, = Z_MIN))
ES_ITEM(HAS_BED_PROBE, Z_MIN_PROBE IF_DISABLED(USE_Z_MIN_PROBE, = Z_MIN))
#endif
// The total number of states // The total number of states
NUM_ENDSTOP_STATES NUM_ENDSTOP_STATES
// Endstop aliased to MIN or MAX // Endstop aliases
#if HAS_X_ENDSTOP #if HAS_X_STATE
, X_ENDSTOP = TERN(X_HOME_TO_MAX, X_MAX, X_MIN) , X_ENDSTOP = TERN(X_HOME_TO_MAX, X_MAX, X_MIN)
#if ENABLED(X_DUAL_ENDSTOPS)
, X2_ENDSTOP = TERN(X_HOME_TO_MAX, X2_MAX, X2_MIN)
#endif
#endif #endif
#if HAS_Y_ENDSTOP #if HAS_X2_STATE
, X2_ENDSTOP = TERN(X_HOME_TO_MAX, X2_MAX, X2_MIN)
#endif
#if HAS_Y_STATE
, Y_ENDSTOP = TERN(Y_HOME_TO_MAX, Y_MAX, Y_MIN) , Y_ENDSTOP = TERN(Y_HOME_TO_MAX, Y_MAX, Y_MIN)
#if ENABLED(Y_DUAL_ENDSTOPS)
, Y2_ENDSTOP = TERN(Y_HOME_TO_MAX, Y2_MAX, Y2_MIN)
#endif
#endif #endif
#if HAS_Y2_STATE
, Y2_ENDSTOP = TERN(Y_HOME_TO_MAX, Y2_MAX, Y2_MIN)
#endif
#if HOMING_Z_WITH_PROBE #if HOMING_Z_WITH_PROBE
, Z_ENDSTOP = Z_MIN_PROBE , Z_ENDSTOP = Z_MIN_PROBE // "Z" endstop alias when homing with the probe
#elif HAS_Z_ENDSTOP #elif HAS_Z_STATE
, Z_ENDSTOP = TERN(Z_HOME_TO_MAX, Z_MAX, Z_MIN) , Z_ENDSTOP = TERN(Z_HOME_TO_MAX, Z_MAX, Z_MIN)
#if ENABLED(Z_MULTI_ENDSTOPS)
, Z2_ENDSTOP = TERN(Z_HOME_TO_MAX, Z2_MAX, Z2_MIN)
#if NUM_Z_STEPPERS >= 3
, Z3_ENDSTOP = TERN(Z_HOME_TO_MAX, Z3_MAX, Z3_MIN)
#if NUM_Z_STEPPERS >= 4
, Z4_ENDSTOP = TERN(Z_HOME_TO_MAX, Z4_MAX, Z4_MIN)
#endif
#endif
#endif
#endif #endif
#if HAS_I_ENDSTOP #if HAS_Z2_STATE
, Z2_ENDSTOP = TERN(Z_HOME_TO_MAX, Z2_MAX, Z2_MIN)
#endif
#if HAS_Z3_STATE
, Z3_ENDSTOP = TERN(Z_HOME_TO_MAX, Z3_MAX, Z3_MIN)
#endif
#if HAS_Z4_STATE
, Z4_ENDSTOP = TERN(Z_HOME_TO_MAX, Z4_MAX, Z4_MIN)
#endif
#if HAS_I_STATE
, I_ENDSTOP = TERN(I_HOME_TO_MAX, I_MAX, I_MIN) , I_ENDSTOP = TERN(I_HOME_TO_MAX, I_MAX, I_MIN)
#endif #endif
#if HAS_J_ENDSTOP #if HAS_J_STATE
, J_ENDSTOP = TERN(J_HOME_TO_MAX, J_MAX, J_MIN) , J_ENDSTOP = TERN(J_HOME_TO_MAX, J_MAX, J_MIN)
#endif #endif
#if HAS_K_ENDSTOP #if HAS_K_STATE
, K_ENDSTOP = TERN(K_HOME_TO_MAX, K_MAX, K_MIN) , K_ENDSTOP = TERN(K_HOME_TO_MAX, K_MAX, K_MIN)
#endif #endif
#if HAS_U_ENDSTOP #if HAS_U_STATE
, U_ENDSTOP = TERN(U_HOME_TO_MAX, U_MAX, U_MIN) , U_ENDSTOP = TERN(U_HOME_TO_MAX, U_MAX, U_MIN)
#endif #endif
#if HAS_V_ENDSTOP #if HAS_V_STATE
, V_ENDSTOP = TERN(V_HOME_TO_MAX, V_MAX, V_MIN) , V_ENDSTOP = TERN(V_HOME_TO_MAX, V_MAX, V_MIN)
#endif #endif
#if HAS_W_ENDSTOP #if HAS_W_STATE
, W_ENDSTOP = TERN(W_HOME_TO_MAX, W_MAX, W_MIN) , W_ENDSTOP = TERN(W_HOME_TO_MAX, W_MAX, W_MIN)
#endif #endif
}; };
#undef _ES_ITEM #undef _ES_ITEM
#undef ES_ITEM #undef ES_ITEM
#undef _ESN_ITEM
#undef ES_MINMAX
class Endstops { class Endstops {
public: public:
@ -288,7 +274,7 @@ class Endstops {
public: public:
// Basic functions for Sensorless Homing // Basic functions for Sensorless Homing
#if USE_SENSORLESS #if USE_SENSORLESS
static void set_homing_current(const bool onoff); static void set_z_sensorless_current(const bool onoff);
#endif #endif
}; };

View file

@ -1718,38 +1718,36 @@ void prepare_line_to_destination() {
#endif #endif
} }
#if ENABLED(SPI_ENDSTOPS) switch (axis) {
switch (axis) { #if X_SPI_SENSORLESS
#if HAS_X_AXIS case X_AXIS: endstops.tmc_spi_homing.x = true; break;
case X_AXIS: if (ENABLED(X_SPI_SENSORLESS)) endstops.tmc_spi_homing.x = true; break; #endif
#endif #if Y_SPI_SENSORLESS
#if HAS_Y_AXIS case Y_AXIS: endstops.tmc_spi_homing.y = true; break;
case Y_AXIS: if (ENABLED(Y_SPI_SENSORLESS)) endstops.tmc_spi_homing.y = true; break; #endif
#endif #if Z_SPI_SENSORLESS
#if HAS_Z_AXIS case Z_AXIS: endstops.tmc_spi_homing.z = true; break;
case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = true; break; #endif
#endif #if I_SPI_SENSORLESS
#if HAS_I_AXIS case I_AXIS: endstops.tmc_spi_homing.i = true; break;
case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = true; break; #endif
#endif #if J_SPI_SENSORLESS
#if HAS_J_AXIS case J_AXIS: endstops.tmc_spi_homing.j = true; break;
case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = true; break; #endif
#endif #if K_SPI_SENSORLESS
#if HAS_K_AXIS case K_AXIS: endstops.tmc_spi_homing.k = true; break;
case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = true; break; #endif
#endif #if U_SPI_SENSORLESS
#if HAS_U_AXIS case U_AXIS: endstops.tmc_spi_homing.u = true; break;
case U_AXIS: if (ENABLED(U_SPI_SENSORLESS)) endstops.tmc_spi_homing.u = true; break; #endif
#endif #if V_SPI_SENSORLESS
#if HAS_V_AXIS case V_AXIS: endstops.tmc_spi_homing.v = true; break;
case V_AXIS: if (ENABLED(V_SPI_SENSORLESS)) endstops.tmc_spi_homing.v = true; break; #endif
#endif #if W_SPI_SENSORLESS
#if HAS_W_AXIS case W_AXIS: endstops.tmc_spi_homing.w = true; break;
case W_AXIS: if (ENABLED(W_SPI_SENSORLESS)) endstops.tmc_spi_homing.w = true; break; #endif
#endif default: break;
default: break; }
}
#endif
TERN_(IMPROVE_HOMING_RELIABILITY, sg_guard_period = millis() + default_sg_guard_duration); TERN_(IMPROVE_HOMING_RELIABILITY, sg_guard_period = millis() + default_sg_guard_duration);
@ -1814,38 +1812,36 @@ void prepare_line_to_destination() {
#endif #endif
} }
#if ENABLED(SPI_ENDSTOPS) switch (axis) {
switch (axis) { #if X_SPI_SENSORLESS
#if HAS_X_AXIS case X_AXIS: endstops.tmc_spi_homing.x = false; break;
case X_AXIS: if (ENABLED(X_SPI_SENSORLESS)) endstops.tmc_spi_homing.x = false; break; #endif
#endif #if Y_SPI_SENSORLESS
#if HAS_Y_AXIS case Y_AXIS: endstops.tmc_spi_homing.y = false; break;
case Y_AXIS: if (ENABLED(Y_SPI_SENSORLESS)) endstops.tmc_spi_homing.y = false; break; #endif
#endif #if Z_SPI_SENSORLESS
#if HAS_Z_AXIS case Z_AXIS: endstops.tmc_spi_homing.z = false; break;
case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = false; break; #endif
#endif #if I_SPI_SENSORLESS
#if HAS_I_AXIS case I_AXIS: endstops.tmc_spi_homing.i = false; break;
case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = false; break; #endif
#endif #if J_SPI_SENSORLESS
#if HAS_J_AXIS case J_AXIS: endstops.tmc_spi_homing.j = false; break;
case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = false; break; #endif
#endif #if K_SPI_SENSORLESS
#if HAS_K_AXIS case K_AXIS: endstops.tmc_spi_homing.k = false; break;
case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = false; break; #endif
#endif #if U_SPI_SENSORLESS
#if HAS_U_AXIS case U_AXIS: endstops.tmc_spi_homing.u = false; break;
case U_AXIS: if (ENABLED(U_SPI_SENSORLESS)) endstops.tmc_spi_homing.u = false; break; #endif
#endif #if V_SPI_SENSORLESS
#if HAS_V_AXIS case V_AXIS: endstops.tmc_spi_homing.v = false; break;
case V_AXIS: if (ENABLED(V_SPI_SENSORLESS)) endstops.tmc_spi_homing.v = false; break; #endif
#endif #if W_SPI_SENSORLESS
#if HAS_W_AXIS case W_AXIS: endstops.tmc_spi_homing.w = false; break;
case W_AXIS: if (ENABLED(W_SPI_SENSORLESS)) endstops.tmc_spi_homing.w = false; break; #endif
#endif default: break;
default: break; }
}
#endif
} }
#endif // SENSORLESS_HOMING #endif // SENSORLESS_HOMING
@ -2118,7 +2114,7 @@ void prepare_line_to_destination() {
// Only Z homing (with probe) is permitted // Only Z homing (with probe) is permitted
if (axis != Z_AXIS) { BUZZ(100, 880); return; } if (axis != Z_AXIS) { BUZZ(100, 880); return; }
#else #else
#define _CAN_HOME(A) (axis == _AXIS(A) && (ANY(A##_SPI_SENSORLESS, HAS_##A##_ENDSTOP) || TERN0(HOMING_Z_WITH_PROBE, _AXIS(A) == Z_AXIS))) #define _CAN_HOME(A) (axis == _AXIS(A) && (ANY(A##_SPI_SENSORLESS, HAS_##A##_STATE) || TERN0(HOMING_Z_WITH_PROBE, _AXIS(A) == Z_AXIS)))
#define _ANDCANT(N) && !_CAN_HOME(N) #define _ANDCANT(N) && !_CAN_HOME(N)
if (true MAIN_AXIS_MAP(_ANDCANT)) return; if (true MAIN_AXIS_MAP(_ANDCANT)) return;
#endif #endif

View file

@ -610,8 +610,19 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
if (test_sensitivity.x) stealth_states.x = tmc_enable_stallguard(stepperX); // Delta watches all DIAG pins for a stall if (test_sensitivity.x) stealth_states.x = tmc_enable_stallguard(stepperX); // Delta watches all DIAG pins for a stall
if (test_sensitivity.y) stealth_states.y = tmc_enable_stallguard(stepperY); if (test_sensitivity.y) stealth_states.y = tmc_enable_stallguard(stepperY);
#endif #endif
if (test_sensitivity.z) stealth_states.z = tmc_enable_stallguard(stepperZ); // All machines will check Z-DIAG for stall if (test_sensitivity.z) {
endstops.set_homing_current(true); // The "homing" current also applies to probing stealth_states.z = tmc_enable_stallguard(stepperZ); // All machines will check Z-DIAG for stall
#if ENABLED(Z_MULTI_ENDSTOPS)
stealth_states.z2 = tmc_enable_stallguard(stepperZ2);
#if NUM_Z_STEPPERS >= 3
stealth_states.z3 = tmc_enable_stallguard(stepperZ3);
#if NUM_Z_STEPPERS >= 4
stealth_states.z4 = tmc_enable_stallguard(stepperZ4);
#endif
#endif
#endif
}
endstops.set_z_sensorless_current(true); // The "homing" current also applies to probing
endstops.enable(true); endstops.enable(true);
#endif // SENSORLESS_PROBING #endif // SENSORLESS_PROBING
@ -643,9 +654,20 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
if (test_sensitivity.x) tmc_disable_stallguard(stepperX, stealth_states.x); if (test_sensitivity.x) tmc_disable_stallguard(stepperX, stealth_states.x);
if (test_sensitivity.y) tmc_disable_stallguard(stepperY, stealth_states.y); if (test_sensitivity.y) tmc_disable_stallguard(stepperY, stealth_states.y);
#endif #endif
if (test_sensitivity.z) tmc_disable_stallguard(stepperZ, stealth_states.z); if (test_sensitivity.z) {
endstops.set_homing_current(false); tmc_disable_stallguard(stepperZ, stealth_states.z);
#endif #if ENABLED(Z_MULTI_ENDSTOPS)
tmc_disable_stallguard(stepperZ2, stealth_states.z2);
#if NUM_Z_STEPPERS >= 3
tmc_disable_stallguard(stepperZ3, stealth_states.z3);
#if NUM_Z_STEPPERS >= 4
tmc_disable_stallguard(stepperZ4, stealth_states.z4);
#endif
#endif
#endif
}
endstops.set_z_sensorless_current(false);
#endif // SENSORLESS_PROBING
#if ENABLED(BLTOUCH) #if ENABLED(BLTOUCH)
if (probe_triggered && !bltouch.high_speed_mode && bltouch.stow()) if (probe_triggered && !bltouch.high_speed_mode && bltouch.stow())

View file

@ -12,8 +12,8 @@ set -e
restore_configs restore_configs
opt_set MOTHERBOARD BOARD_BTT_BTT002_V1_0 \ opt_set MOTHERBOARD BOARD_BTT_BTT002_V1_0 \
SERIAL_PORT 1 \ SERIAL_PORT 1 \
X_DRIVER_TYPE TMC2209 \ X_DRIVER_TYPE TMC2209 Y_DRIVER_TYPE TMC2130
Y_DRIVER_TYPE TMC2130 opt_enable SENSORLESS_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY SPI_ENDSTOPS
exec_test $1 $2 "BigTreeTech BTT002 Default Configuration plus TMC steppers" "$3" exec_test $1 $2 "BigTreeTech BTT002 Default Configuration plus TMC steppers" "$3"
# #

View file

@ -50,9 +50,16 @@ opt_set MOTHERBOARD BOARD_FYSETC_F6_13 \
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \
MARLIN_BRICKOUT MARLIN_INVADERS MARLIN_SNAKE \ MARLIN_BRICKOUT MARLIN_INVADERS MARLIN_SNAKE \
MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD \ MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD \
SENSORLESS_HOMING TMC_DEBUG M114_DETAIL SENSORLESS_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY TMC_DEBUG M114_DETAIL
exec_test $1 $2 "Mixed TMC | Sensorless | RRDFGSC | Games" "$3" exec_test $1 $2 "Mixed TMC | Sensorless | RRDFGSC | Games" "$3"
#
# Delta Config (FLSUN AC because it's complex)
#
use_example_configs delta/FLSUN/auto_calibrate
opt_set MOTHERBOARD BOARD_FYSETC_F6_13
exec_test $1 $2 "RAMPS 1.3 | DELTA | FLSUN AC Config" "$3"
# #
# SCARA with Mixed TMC # SCARA with Mixed TMC
# #
@ -64,7 +71,7 @@ opt_set MOTHERBOARD BOARD_FYSETC_F6_13 \
X_HARDWARE_SERIAL Serial2 X_HARDWARE_SERIAL Serial2
opt_enable FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \ opt_enable FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \
FYSETC_242_OLED_12864 EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL Z_SAFE_HOMING \ FYSETC_242_OLED_12864 EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL Z_SAFE_HOMING \
STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING EDGE_STEPPING STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY EDGE_STEPPING
exec_test $1 $2 "SCARA | Mixed TMC | EEPROM" "$3" exec_test $1 $2 "SCARA | Mixed TMC | EEPROM" "$3"
# clean up # clean up

View file

@ -53,14 +53,15 @@ opt_set MOTHERBOARD BOARD_COHESION3D_REMIX \
HOMING_FEEDRATE_MM_M '{ (50*60), (50*60), (4*60), (50*60) }' \ HOMING_FEEDRATE_MM_M '{ (50*60), (50*60), (4*60), (50*60) }' \
HOMING_BUMP_MM '{ 0, 0, 0, 0 }' HOMING_BUMP_DIVISOR '{ 1, 1, 1, 1 }' \ HOMING_BUMP_MM '{ 0, 0, 0, 0 }' HOMING_BUMP_DIVISOR '{ 1, 1, 1, 1 }' \
NOZZLE_TO_PROBE_OFFSET '{ 0, 0, 0, 0 }' \ NOZZLE_TO_PROBE_OFFSET '{ 0, 0, 0, 0 }' \
I_MIN_PIN P1_25 I_MIN_PIN P1_25 \
X_CURRENT_HOME 750 Y_CURRENT_HOME 750 Z_CURRENT_HOME 750
opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT MECHANICAL_GANTRY_CALIBRATION \ opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT MECHANICAL_GANTRY_CALIBRATION \
TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z HYBRID_THRESHOLD \ TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z HYBRID_THRESHOLD \
SENSORLESS_PROBING Z_SAFE_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY TMC_DEBUG \ SENSORLESS_PROBING SENSORLESS_HOMING Z_SAFE_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY TMC_DEBUG \
AXIS4_ROTATES I_MIN_POS I_MAX_POS I_HOME_DIR I_ENABLE_ON INVERT_I_DIR \ AXIS4_ROTATES I_MIN_POS I_MAX_POS I_HOME_DIR I_ENABLE_ON INVERT_I_DIR \
EXPERIMENTAL_I2CBUS EXPERIMENTAL_I2CBUS
opt_disable PSU_CONTROL Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN opt_disable PSU_CONTROL Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
exec_test $1 $2 "Cohesion3D Remix DELTA + ABL Bilinear + EEPROM + SENSORLESS_PROBING + I Axis" "$3" exec_test $1 $2 "Cohesion3D Remix DELTA | ABL Bilinear | EEPROM | Sensorless Homing/Probing | I Axis" "$3"
# clean up # clean up
restore_configs restore_configs

View file

@ -25,8 +25,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE BLTOUCH Z_MIN_PROBE_REPEATABILITY_TEST \
LONG_FILENAME_HOST_SUPPORT CUSTOM_FIRMWARE_UPLOAD M20_TIMESTAMP_SUPPORT \ LONG_FILENAME_HOST_SUPPORT CUSTOM_FIRMWARE_UPLOAD M20_TIMESTAMP_SUPPORT \
SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \
MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \ MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS
EDGE_STEPPING
exec_test $1 $2 "Minitronics 2.0 with assorted features" "$3" exec_test $1 $2 "Minitronics 2.0 with assorted features" "$3"
# clean up # clean up

View file

@ -25,7 +25,8 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R
LONG_FILENAME_HOST_SUPPORT CUSTOM_FIRMWARE_UPLOAD M20_TIMESTAMP_SUPPORT \ LONG_FILENAME_HOST_SUPPORT CUSTOM_FIRMWARE_UPLOAD M20_TIMESTAMP_SUPPORT \
SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \
MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \ MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS \
SENSORLESS_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY Z2_STALL_SENSITIVITY \
EDGE_STEPPING TMC_DEBUG EDGE_STEPPING TMC_DEBUG
exec_test $1 $2 "Grand Central M4 with assorted features" "$3" exec_test $1 $2 "Grand Central M4 with assorted features" "$3"

View file

@ -41,6 +41,7 @@ opt_set MOTHERBOARD BOARD_ZRIB_V52 \
LCD_LANGUAGE pt REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 \ LCD_LANGUAGE pt REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 \
EXTRUDERS 2 TEMP_SENSOR_1 1 X2_DRIVER_TYPE A4988 EXTRUDERS 2 TEMP_SENSOR_1 1 X2_DRIVER_TYPE A4988
opt_enable DUAL_X_CARRIAGE REPRAPWORLD_KEYPAD opt_enable DUAL_X_CARRIAGE REPRAPWORLD_KEYPAD
opt_add DEBUG_DXC_MODE
exec_test $1 $2 "ZRIB_V52 | DUAL_X_CARRIAGE" "$3" exec_test $1 $2 "ZRIB_V52 | DUAL_X_CARRIAGE" "$3"
# #

View file

@ -85,9 +85,10 @@ exec_test $1 $2 "Mixing Extruder" "$3"
restore_configs restore_configs
opt_set MOTHERBOARD BOARD_TEENSY35_36 \ opt_set MOTHERBOARD BOARD_TEENSY35_36 \
X_DRIVER_TYPE TMC5160 Y_DRIVER_TYPE TMC5160 \ X_DRIVER_TYPE TMC5160 Y_DRIVER_TYPE TMC5160 \
X_CURRENT_HOME 750 Y_CURRENT_HOME 750 \
X_MIN_ENDSTOP_HIT_STATE LOW Y_MIN_ENDSTOP_HIT_STATE LOW \ X_MIN_ENDSTOP_HIT_STATE LOW Y_MIN_ENDSTOP_HIT_STATE LOW \
X_CS_PIN 46 Y_CS_PIN 47 X_CS_PIN 46 Y_CS_PIN 47
opt_enable COREXY MONITOR_DRIVER_STATUS SENSORLESS_HOMING opt_enable COREXY MONITOR_DRIVER_STATUS SENSORLESS_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY
exec_test $1 $2 "Teensy 3.5/3.6 COREXY" "$3" exec_test $1 $2 "Teensy 3.5/3.6 COREXY" "$3"
# #