🐛 Fix Anycubic / Trigorilla pins, etc. (#24971)

This commit is contained in:
Scott Lahteine 2022-11-11 20:35:07 -06:00
parent 379d388b07
commit c9fa680db9
9 changed files with 606 additions and 540 deletions

View File

@ -153,6 +153,9 @@ class PrintJobRecovery {
static void prepare();
static void setup() {
#if PIN_EXISTS(OUTAGECON)
OUT_WRITE(OUTAGECON_PIN, HIGH);
#endif
#if PIN_EXISTS(POWER_LOSS)
#if ENABLED(POWER_LOSS_PULLUP)
SET_INPUT_PULLUP(POWER_LOSS_PIN);

View File

@ -313,9 +313,16 @@ void GcodeSuite::M43() {
// 'P' Get the range of pins to test or watch
uint8_t first_pin = PARSED_PIN_INDEX('P', 0),
last_pin = parser.seenval('P') ? first_pin : (NUMBER_PINS_TOTAL) - 1;
last_pin = parser.seenval('L') ? PARSED_PIN_INDEX('L', 0) : parser.seenval('P') ? first_pin : (NUMBER_PINS_TOTAL) - 1;
if (first_pin > last_pin) return;
NOMORE(first_pin, (NUMBER_PINS_TOTAL) - 1);
NOMORE(last_pin, (NUMBER_PINS_TOTAL) - 1);
if (first_pin > last_pin) {
const uint8_t f = first_pin;
first_pin = last_pin;
last_pin = f;
}
// 'I' to ignore protected pins
const bool ignore_protection = parser.boolval('I');

View File

@ -50,6 +50,7 @@ void GcodeSuite::M900() {
#if EXTRUDERS < 2
constexpr uint8_t tool_index = 0;
UNUSED(tool_index);
#else
const uint8_t tool_index = parser.intval('T', active_extruder);
if (tool_index >= EXTRUDERS) {

View File

@ -926,56 +926,8 @@
#define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define X2_MAX_ENDSTOP_INVERTING false
#endif
#endif
#if !defined(X2_MAX_PIN) && !defined(X2_STOP_PIN)
#if X2_USE_ENDSTOP == _XMIN_
#define X2_MAX_PIN X_MIN_PIN
#elif X2_USE_ENDSTOP == _XMAX_
#define X2_MAX_PIN X_MAX_PIN
#elif X2_USE_ENDSTOP == _XSTOP_
#define X2_MAX_PIN X_STOP_PIN
#elif X2_USE_ENDSTOP == _YMIN_
#define X2_MAX_PIN Y_MIN_PIN
#elif X2_USE_ENDSTOP == _YMAX_
#define X2_MAX_PIN Y_MAX_PIN
#elif X2_USE_ENDSTOP == _YSTOP_
#define X2_MAX_PIN Y_STOP_PIN
#elif X2_USE_ENDSTOP == _ZMIN_
#define X2_MAX_PIN Z_MIN_PIN
#elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MAX_PIN Z_MAX_PIN
#elif X2_USE_ENDSTOP == _ZSTOP_
#define X2_MAX_PIN Z_STOP_PIN
#elif X2_USE_ENDSTOP == _XDIAG_
#define X2_MAX_PIN X_DIAG_PIN
#elif X2_USE_ENDSTOP == _YDIAG_
#define X2_MAX_PIN Y_DIAG_PIN
#elif X2_USE_ENDSTOP == _ZDIAG_
#define X2_MAX_PIN Z_DIAG_PIN
#elif X2_USE_ENDSTOP == _E0DIAG_
#define X2_MAX_PIN E0_DIAG_PIN
#elif X2_USE_ENDSTOP == _E1DIAG_
#define X2_MAX_PIN E1_DIAG_PIN
#elif X2_USE_ENDSTOP == _E2DIAG_
#define X2_MAX_PIN E2_DIAG_PIN
#elif X2_USE_ENDSTOP == _E3DIAG_
#define X2_MAX_PIN E3_DIAG_PIN
#elif X2_USE_ENDSTOP == _E4DIAG_
#define X2_MAX_PIN E4_DIAG_PIN
#elif X2_USE_ENDSTOP == _E5DIAG_
#define X2_MAX_PIN E5_DIAG_PIN
#elif X2_USE_ENDSTOP == _E6DIAG_
#define X2_MAX_PIN E6_DIAG_PIN
#elif X2_USE_ENDSTOP == _E7DIAG_
#define X2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#ifndef X2_MIN_ENDSTOP_INVERTING
#define X2_MIN_ENDSTOP_INVERTING false
#endif
#else
#ifndef X2_MIN_ENDSTOP_INVERTING
#if X2_USE_ENDSTOP == _XMIN_
@ -990,56 +942,14 @@
#define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define X2_MIN_ENDSTOP_INVERTING false
#endif
#endif
#if !defined(X2_MIN_PIN) && !defined(X2_STOP_PIN)
#if X2_USE_ENDSTOP == _XMIN_
#define X2_MIN_PIN X_MIN_PIN
#elif X2_USE_ENDSTOP == _XMAX_
#define X2_MIN_PIN X_MAX_PIN
#elif X2_USE_ENDSTOP == _XSTOP_
#define X2_MIN_PIN X_STOP_PIN
#elif X2_USE_ENDSTOP == _YMIN_
#define X2_MIN_PIN Y_MIN_PIN
#elif X2_USE_ENDSTOP == _YMAX_
#define X2_MIN_PIN Y_MAX_PIN
#elif X2_USE_ENDSTOP == _YSTOP_
#define X2_MIN_PIN Y_STOP_PIN
#elif X2_USE_ENDSTOP == _ZMIN_
#define X2_MIN_PIN Z_MIN_PIN
#elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MIN_PIN Z_MAX_PIN
#elif X2_USE_ENDSTOP == _ZSTOP_
#define X2_MIN_PIN Z_STOP_PIN
#elif X2_USE_ENDSTOP == _XDIAG_
#define X2_MIN_PIN X_DIAG_PIN
#elif X2_USE_ENDSTOP == _YDIAG_
#define X2_MIN_PIN Y_DIAG_PIN
#elif X2_USE_ENDSTOP == _ZDIAG_
#define X2_MIN_PIN Z_DIAG_PIN
#elif X2_USE_ENDSTOP == _E0DIAG_
#define X2_MIN_PIN E0_DIAG_PIN
#elif X2_USE_ENDSTOP == _E1DIAG_
#define X2_MIN_PIN E1_DIAG_PIN
#elif X2_USE_ENDSTOP == _E2DIAG_
#define X2_MIN_PIN E2_DIAG_PIN
#elif X2_USE_ENDSTOP == _E3DIAG_
#define X2_MIN_PIN E3_DIAG_PIN
#elif X2_USE_ENDSTOP == _E4DIAG_
#define X2_MIN_PIN E4_DIAG_PIN
#elif X2_USE_ENDSTOP == _E5DIAG_
#define X2_MIN_PIN E5_DIAG_PIN
#elif X2_USE_ENDSTOP == _E6DIAG_
#define X2_MIN_PIN E6_DIAG_PIN
#elif X2_USE_ENDSTOP == _E7DIAG_
#define X2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#ifndef X2_MAX_ENDSTOP_INVERTING
#define X2_MAX_ENDSTOP_INVERTING false
#endif
#endif
#ifndef X2_MAX_ENDSTOP_INVERTING
#define X2_MAX_ENDSTOP_INVERTING false
#endif
#ifndef X2_MIN_ENDSTOP_INVERTING
#define X2_MIN_ENDSTOP_INVERTING false
#endif
#endif
@ -1061,56 +971,8 @@
#define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Y2_MAX_ENDSTOP_INVERTING false
#endif
#endif
#if !defined(Y2_MAX_PIN) && !defined(Y2_STOP_PIN)
#if Y2_USE_ENDSTOP == _XMIN_
#define Y2_MAX_PIN X_MIN_PIN
#elif Y2_USE_ENDSTOP == _XMAX_
#define Y2_MAX_PIN X_MAX_PIN
#elif Y2_USE_ENDSTOP == _XSTOP_
#define Y2_MAX_PIN X_STOP_PIN
#elif Y2_USE_ENDSTOP == _YMIN_
#define Y2_MAX_PIN Y_MIN_PIN
#elif Y2_USE_ENDSTOP == _YMAX_
#define Y2_MAX_PIN Y_MAX_PIN
#elif Y2_USE_ENDSTOP == _YSTOP_
#define Y2_MAX_PIN Y_STOP_PIN
#elif Y2_USE_ENDSTOP == _ZMIN_
#define Y2_MAX_PIN Z_MIN_PIN
#elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MAX_PIN Z_MAX_PIN
#elif Y2_USE_ENDSTOP == _ZSTOP_
#define Y2_MAX_PIN Z_STOP_PIN
#elif Y2_USE_ENDSTOP == _XDIAG_
#define Y2_MAX_PIN X_DIAG_PIN
#elif Y2_USE_ENDSTOP == _YDIAG_
#define Y2_MAX_PIN Y_DIAG_PIN
#elif Y2_USE_ENDSTOP == _ZDIAG_
#define Y2_MAX_PIN Z_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E0DIAG_
#define Y2_MAX_PIN E0_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E1DIAG_
#define Y2_MAX_PIN E1_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E2DIAG_
#define Y2_MAX_PIN E2_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E3DIAG_
#define Y2_MAX_PIN E3_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E4DIAG_
#define Y2_MAX_PIN E4_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E5DIAG_
#define Y2_MAX_PIN E5_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E6DIAG_
#define Y2_MAX_PIN E6_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E7DIAG_
#define Y2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Y2_MIN_ENDSTOP_INVERTING
#define Y2_MIN_ENDSTOP_INVERTING false
#endif
#else
#ifndef Y2_MIN_ENDSTOP_INVERTING
#if Y2_USE_ENDSTOP == _XMIN_
@ -1125,56 +987,14 @@
#define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Y2_MIN_ENDSTOP_INVERTING false
#endif
#endif
#if !defined(Y2_MIN_PIN) && !defined(Y2_STOP_PIN)
#if Y2_USE_ENDSTOP == _XMIN_
#define Y2_MIN_PIN X_MIN_PIN
#elif Y2_USE_ENDSTOP == _XMAX_
#define Y2_MIN_PIN X_MAX_PIN
#elif Y2_USE_ENDSTOP == _XSTOP_
#define Y2_MIN_PIN X_STOP_PIN
#elif Y2_USE_ENDSTOP == _YMIN_
#define Y2_MIN_PIN Y_MIN_PIN
#elif Y2_USE_ENDSTOP == _YMAX_
#define Y2_MIN_PIN Y_MAX_PIN
#elif Y2_USE_ENDSTOP == _YSTOP_
#define Y2_MIN_PIN Y_STOP_PIN
#elif Y2_USE_ENDSTOP == _ZMIN_
#define Y2_MIN_PIN Z_MIN_PIN
#elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MIN_PIN Z_MAX_PIN
#elif Y2_USE_ENDSTOP == _ZSTOP_
#define Y2_MIN_PIN Z_STOP_PIN
#elif Y2_USE_ENDSTOP == _XDIAG_
#define Y2_MIN_PIN X_DIAG_PIN
#elif Y2_USE_ENDSTOP == _YDIAG_
#define Y2_MIN_PIN Y_DIAG_PIN
#elif Y2_USE_ENDSTOP == _ZDIAG_
#define Y2_MIN_PIN Z_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E0DIAG_
#define Y2_MIN_PIN E0_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E1DIAG_
#define Y2_MIN_PIN E1_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E2DIAG_
#define Y2_MIN_PIN E2_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E3DIAG_
#define Y2_MIN_PIN E3_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E4DIAG_
#define Y2_MIN_PIN E4_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E5DIAG_
#define Y2_MIN_PIN E5_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E6DIAG_
#define Y2_MIN_PIN E6_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E7DIAG_
#define Y2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Y2_MAX_ENDSTOP_INVERTING
#define Y2_MAX_ENDSTOP_INVERTING false
#endif
#endif
#ifndef Y2_MAX_ENDSTOP_INVERTING
#define Y2_MAX_ENDSTOP_INVERTING false
#endif
#ifndef Y2_MIN_ENDSTOP_INVERTING
#define Y2_MIN_ENDSTOP_INVERTING false
#endif
#endif
@ -1197,56 +1017,8 @@
#define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z2_MAX_ENDSTOP_INVERTING false
#endif
#endif
#if !defined(Z2_MAX_PIN) && !defined(Z2_STOP_PIN)
#if Z2_USE_ENDSTOP == _XMIN_
#define Z2_MAX_PIN X_MIN_PIN
#elif Z2_USE_ENDSTOP == _XMAX_
#define Z2_MAX_PIN X_MAX_PIN
#elif Z2_USE_ENDSTOP == _XSTOP_
#define Z2_MAX_PIN X_STOP_PIN
#elif Z2_USE_ENDSTOP == _YMIN_
#define Z2_MAX_PIN Y_MIN_PIN
#elif Z2_USE_ENDSTOP == _YMAX_
#define Z2_MAX_PIN Y_MAX_PIN
#elif Z2_USE_ENDSTOP == _YSTOP_
#define Z2_MAX_PIN Y_STOP_PIN
#elif Z2_USE_ENDSTOP == _ZMIN_
#define Z2_MAX_PIN Z_MIN_PIN
#elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MAX_PIN Z_MAX_PIN
#elif Z2_USE_ENDSTOP == _ZSTOP_
#define Z2_MAX_PIN Z_STOP_PIN
#elif Z2_USE_ENDSTOP == _XDIAG_
#define Z2_MAX_PIN X_DIAG_PIN
#elif Z2_USE_ENDSTOP == _YDIAG_
#define Z2_MAX_PIN Y_DIAG_PIN
#elif Z2_USE_ENDSTOP == _ZDIAG_
#define Z2_MAX_PIN Z_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E0DIAG_
#define Z2_MAX_PIN E0_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E1DIAG_
#define Z2_MAX_PIN E1_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E2DIAG_
#define Z2_MAX_PIN E2_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E3DIAG_
#define Z2_MAX_PIN E3_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E4DIAG_
#define Z2_MAX_PIN E4_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E5DIAG_
#define Z2_MAX_PIN E5_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E6DIAG_
#define Z2_MAX_PIN E6_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E7DIAG_
#define Z2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z2_MIN_ENDSTOP_INVERTING
#define Z2_MIN_ENDSTOP_INVERTING false
#endif
#else
#ifndef Z2_MIN_ENDSTOP_INVERTING
#if Z2_USE_ENDSTOP == _XMIN_
@ -1261,56 +1033,14 @@
#define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z2_MIN_ENDSTOP_INVERTING false
#endif
#endif
#ifndef Z2_MIN_PIN
#if Z2_USE_ENDSTOP == _XMIN_
#define Z2_MIN_PIN X_MIN_PIN
#elif Z2_USE_ENDSTOP == _XMAX_
#define Z2_MIN_PIN X_MAX_PIN
#elif Z2_USE_ENDSTOP == _XSTOP_
#define Z2_MIN_PIN X_STOP_PIN
#elif Z2_USE_ENDSTOP == _YMIN_
#define Z2_MIN_PIN Y_MIN_PIN
#elif Z2_USE_ENDSTOP == _YMAX_
#define Z2_MIN_PIN Y_MAX_PIN
#elif Z2_USE_ENDSTOP == _YSTOP_
#define Z2_MIN_PIN Y_STOP_PIN
#elif Z2_USE_ENDSTOP == _ZMIN_
#define Z2_MIN_PIN Z_MIN_PIN
#elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MIN_PIN Z_MAX_PIN
#elif Z2_USE_ENDSTOP == _ZSTOP_
#define Z2_MIN_PIN Z_STOP_PIN
#elif Z2_USE_ENDSTOP == _XDIAG_
#define Z2_MIN_PIN X_DIAG_PIN
#elif Z2_USE_ENDSTOP == _YDIAG_
#define Z2_MIN_PIN Y_DIAG_PIN
#elif Z2_USE_ENDSTOP == _ZDIAG_
#define Z2_MIN_PIN Z_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E0DIAG_
#define Z2_MIN_PIN E0_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E1DIAG_
#define Z2_MIN_PIN E1_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E2DIAG_
#define Z2_MIN_PIN E2_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E3DIAG_
#define Z2_MIN_PIN E3_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E4DIAG_
#define Z2_MIN_PIN E4_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E5DIAG_
#define Z2_MIN_PIN E5_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E6DIAG_
#define Z2_MIN_PIN E6_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E7DIAG_
#define Z2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z2_MAX_ENDSTOP_INVERTING
#define Z2_MAX_ENDSTOP_INVERTING false
#endif
#endif
#ifndef Z2_MAX_ENDSTOP_INVERTING
#define Z2_MAX_ENDSTOP_INVERTING false
#endif
#ifndef Z2_MIN_ENDSTOP_INVERTING
#define Z2_MIN_ENDSTOP_INVERTING false
#endif
#if NUM_Z_STEPPERS >= 3
@ -1328,56 +1058,8 @@
#define Z3_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z3_MAX_ENDSTOP_INVERTING false
#endif
#endif
#ifndef Z3_MAX_PIN
#if Z3_USE_ENDSTOP == _XMIN_
#define Z3_MAX_PIN X_MIN_PIN
#elif Z3_USE_ENDSTOP == _XMAX_
#define Z3_MAX_PIN X_MAX_PIN
#elif Z3_USE_ENDSTOP == _XSTOP_
#define Z3_MAX_PIN X_STOP_PIN
#elif Z3_USE_ENDSTOP == _YMIN_
#define Z3_MAX_PIN Y_MIN_PIN
#elif Z3_USE_ENDSTOP == _YMAX_
#define Z3_MAX_PIN Y_MAX_PIN
#elif Z3_USE_ENDSTOP == _YSTOP_
#define Z3_MAX_PIN Y_STOP_PIN
#elif Z3_USE_ENDSTOP == _ZMIN_
#define Z3_MAX_PIN Z_MIN_PIN
#elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MAX_PIN Z_MAX_PIN
#elif Z3_USE_ENDSTOP == _ZSTOP_
#define Z3_MAX_PIN Z_STOP_PIN
#elif Z3_USE_ENDSTOP == _XDIAG_
#define Z3_MAX_PIN X_DIAG_PIN
#elif Z3_USE_ENDSTOP == _YDIAG_
#define Z3_MAX_PIN Y_DIAG_PIN
#elif Z3_USE_ENDSTOP == _ZDIAG_
#define Z3_MAX_PIN Z_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E0DIAG_
#define Z3_MAX_PIN E0_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E1DIAG_
#define Z3_MAX_PIN E1_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E2DIAG_
#define Z3_MAX_PIN E2_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E3DIAG_
#define Z3_MAX_PIN E3_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E4DIAG_
#define Z3_MAX_PIN E4_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E5DIAG_
#define Z3_MAX_PIN E5_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E6DIAG_
#define Z3_MAX_PIN E6_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E7DIAG_
#define Z3_MAX_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z3_MIN_ENDSTOP_INVERTING
#define Z3_MIN_ENDSTOP_INVERTING false
#endif
#else
#ifndef Z3_MIN_ENDSTOP_INVERTING
#if Z3_USE_ENDSTOP == _XMIN_
@ -1392,56 +1074,14 @@
#define Z3_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z3_MIN_ENDSTOP_INVERTING false
#endif
#endif
#ifndef Z3_MIN_PIN
#if Z3_USE_ENDSTOP == _XMIN_
#define Z3_MIN_PIN X_MIN_PIN
#elif Z3_USE_ENDSTOP == _XMAX_
#define Z3_MIN_PIN X_MAX_PIN
#elif Z3_USE_ENDSTOP == _XSTOP_
#define Z3_MIN_PIN X_STOP_PIN
#elif Z3_USE_ENDSTOP == _YMIN_
#define Z3_MIN_PIN Y_MIN_PIN
#elif Z3_USE_ENDSTOP == _YMAX_
#define Z3_MIN_PIN Y_MAX_PIN
#elif Z3_USE_ENDSTOP == _YSTOP_
#define Z3_MIN_PIN Y_STOP_PIN
#elif Z3_USE_ENDSTOP == _ZMIN_
#define Z3_MIN_PIN Z_MIN_PIN
#elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MIN_PIN Z_MAX_PIN
#elif Z3_USE_ENDSTOP == _ZSTOP_
#define Z3_MIN_PIN Z_STOP_PIN
#elif Z3_USE_ENDSTOP == _XDIAG_
#define Z3_MIN_PIN X_DIAG_PIN
#elif Z3_USE_ENDSTOP == _YDIAG_
#define Z3_MIN_PIN Y_DIAG_PIN
#elif Z3_USE_ENDSTOP == _ZDIAG_
#define Z3_MIN_PIN Z_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E0DIAG_
#define Z3_MIN_PIN E0_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E1DIAG_
#define Z3_MIN_PIN E1_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E2DIAG_
#define Z3_MIN_PIN E2_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E3DIAG_
#define Z3_MIN_PIN E3_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E4DIAG_
#define Z3_MIN_PIN E4_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E5DIAG_
#define Z3_MIN_PIN E5_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E6DIAG_
#define Z3_MIN_PIN E6_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E7DIAG_
#define Z3_MIN_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z3_MAX_ENDSTOP_INVERTING
#define Z3_MAX_ENDSTOP_INVERTING false
#endif
#endif
#ifndef Z3_MAX_ENDSTOP_INVERTING
#define Z3_MAX_ENDSTOP_INVERTING false
#endif
#ifndef Z3_MIN_ENDSTOP_INVERTING
#define Z3_MIN_ENDSTOP_INVERTING false
#endif
#endif
@ -1460,56 +1100,8 @@
#define Z4_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z4_MAX_ENDSTOP_INVERTING false
#endif
#endif
#ifndef Z4_MAX_PIN
#if Z4_USE_ENDSTOP == _XMIN_
#define Z4_MAX_PIN X_MIN_PIN
#elif Z4_USE_ENDSTOP == _XMAX_
#define Z4_MAX_PIN X_MAX_PIN
#elif Z4_USE_ENDSTOP == _XSTOP_
#define Z4_MAX_PIN X_STOP_PIN
#elif Z4_USE_ENDSTOP == _YMIN_
#define Z4_MAX_PIN Y_MIN_PIN
#elif Z4_USE_ENDSTOP == _YMAX_
#define Z4_MAX_PIN Y_MAX_PIN
#elif Z4_USE_ENDSTOP == _YSTOP_
#define Z4_MAX_PIN Y_STOP_PIN
#elif Z4_USE_ENDSTOP == _ZMIN_
#define Z4_MAX_PIN Z_MIN_PIN
#elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MAX_PIN Z_MAX_PIN
#elif Z4_USE_ENDSTOP == _ZSTOP_
#define Z4_MAX_PIN Z_STOP_PIN
#elif Z4_USE_ENDSTOP == _XDIAG_
#define Z4_MAX_PIN X_DIAG_PIN
#elif Z4_USE_ENDSTOP == _YDIAG_
#define Z4_MAX_PIN Y_DIAG_PIN
#elif Z4_USE_ENDSTOP == _ZDIAG_
#define Z4_MAX_PIN Z_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E0DIAG_
#define Z4_MAX_PIN E0_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E1DIAG_
#define Z4_MAX_PIN E1_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E2DIAG_
#define Z4_MAX_PIN E2_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E3DIAG_
#define Z4_MAX_PIN E3_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E4DIAG_
#define Z4_MAX_PIN E4_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E5DIAG_
#define Z4_MAX_PIN E5_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E6DIAG_
#define Z4_MAX_PIN E6_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E7DIAG_
#define Z4_MAX_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z4_MIN_ENDSTOP_INVERTING
#define Z4_MIN_ENDSTOP_INVERTING false
#endif
#else
#ifndef Z4_MIN_ENDSTOP_INVERTING
#if Z4_USE_ENDSTOP == _XMIN_
@ -1524,56 +1116,14 @@
#define Z4_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
#elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#else
#define Z4_MIN_ENDSTOP_INVERTING false
#endif
#endif
#ifndef Z4_MIN_PIN
#if Z4_USE_ENDSTOP == _XMIN_
#define Z4_MIN_PIN X_MIN_PIN
#elif Z4_USE_ENDSTOP == _XMAX_
#define Z4_MIN_PIN X_MAX_PIN
#elif Z4_USE_ENDSTOP == _XSTOP_
#define Z4_MIN_PIN X_STOP_PIN
#elif Z4_USE_ENDSTOP == _YMIN_
#define Z4_MIN_PIN Y_MIN_PIN
#elif Z4_USE_ENDSTOP == _YMAX_
#define Z4_MIN_PIN Y_MAX_PIN
#elif Z4_USE_ENDSTOP == _YSTOP_
#define Z4_MIN_PIN Y_STOP_PIN
#elif Z4_USE_ENDSTOP == _ZMIN_
#define Z4_MIN_PIN Z_MIN_PIN
#elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MIN_PIN Z_MAX_PIN
#elif Z4_USE_ENDSTOP == _ZSTOP_
#define Z4_MIN_PIN Z_STOP_PIN
#elif Z4_USE_ENDSTOP == _XDIAG_
#define Z4_MIN_PIN X_DIAG_PIN
#elif Z4_USE_ENDSTOP == _YDIAG_
#define Z4_MIN_PIN Y_DIAG_PIN
#elif Z4_USE_ENDSTOP == _ZDIAG_
#define Z4_MIN_PIN Z_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E0DIAG_
#define Z4_MIN_PIN E0_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E1DIAG_
#define Z4_MIN_PIN E1_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E2DIAG_
#define Z4_MIN_PIN E2_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E3DIAG_
#define Z4_MIN_PIN E3_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E4DIAG_
#define Z4_MIN_PIN E4_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E5DIAG_
#define Z4_MIN_PIN E5_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E6DIAG_
#define Z4_MIN_PIN E6_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E7DIAG_
#define Z4_MIN_PIN E7_DIAG_PIN
#endif
#endif
#ifndef Z4_MAX_ENDSTOP_INVERTING
#define Z4_MAX_ENDSTOP_INVERTING false
#endif
#endif
#ifndef Z4_MAX_ENDSTOP_INVERTING
#define Z4_MAX_ENDSTOP_INVERTING false
#endif
#ifndef Z4_MIN_ENDSTOP_INVERTING
#define Z4_MIN_ENDSTOP_INVERTING false
#endif
#endif

View File

@ -72,17 +72,6 @@ void ChironTFT::Startup() {
live_Zoffset = 0.0;
file_menu = AC_menu_file;
// Setup pins for powerloss detection
// Two IO pins are connected on the Trigorilla Board
// On a power interruption the OUTAGECON_PIN goes low.
#if ENABLED(POWER_LOSS_RECOVERY)
OUT_WRITE(OUTAGECON_PIN, HIGH);
#endif
// Filament runout is handled by Marlin settings in Configuration.h
// opt_set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present.
// opt_enable FIL_RUNOUT_PULLUP
TFTSer.begin(115200);
// Wait for the TFT panel to initialize and finish the animation

View File

@ -883,6 +883,9 @@
#if PIN_EXISTS(SAFE_POWER)
REPORT_NAME_DIGITAL(__LINE__, SAFE_POWER_PIN)
#endif
#if PIN_EXISTS(OUTAGECON)
REPORT_NAME_DIGITAL(__LINE__, OUTAGECON_PIN)
#endif
#if PIN_EXISTS(POWER_LOSS)
REPORT_NAME_DIGITAL(__LINE__, POWER_LOSS_PIN)
#endif

View File

@ -1857,6 +1857,497 @@
#undef Z4_MAX_PIN
#endif
/**
* X_DUAL_ENDSTOPS endstop reassignment
*/
#if ENABLED(X_DUAL_ENDSTOPS)
#if X_HOME_TO_MAX
#ifndef X2_MAX_PIN
#if PIN_EXISTS(X2_STOP)
#define X2_MAX_PIN X2_STOP_PIN
#elif X2_USE_ENDSTOP == _XMIN_
#define X2_MAX_PIN X_MIN_PIN
#elif X2_USE_ENDSTOP == _XMAX_
#define X2_MAX_PIN X_MAX_PIN
#elif X2_USE_ENDSTOP == _XSTOP_
#define X2_MAX_PIN X_STOP_PIN
#elif X2_USE_ENDSTOP == _YMIN_
#define X2_MAX_PIN Y_MIN_PIN
#elif X2_USE_ENDSTOP == _YMAX_
#define X2_MAX_PIN Y_MAX_PIN
#elif X2_USE_ENDSTOP == _YSTOP_
#define X2_MAX_PIN Y_STOP_PIN
#elif X2_USE_ENDSTOP == _ZMIN_
#define X2_MAX_PIN Z_MIN_PIN
#elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MAX_PIN Z_MAX_PIN
#elif X2_USE_ENDSTOP == _ZSTOP_
#define X2_MAX_PIN Z_STOP_PIN
#elif X2_USE_ENDSTOP == _XDIAG_
#define X2_MAX_PIN X_DIAG_PIN
#elif X2_USE_ENDSTOP == _YDIAG_
#define X2_MAX_PIN Y_DIAG_PIN
#elif X2_USE_ENDSTOP == _ZDIAG_
#define X2_MAX_PIN Z_DIAG_PIN
#elif X2_USE_ENDSTOP == _E0DIAG_
#define X2_MAX_PIN E0_DIAG_PIN
#elif X2_USE_ENDSTOP == _E1DIAG_
#define X2_MAX_PIN E1_DIAG_PIN
#elif X2_USE_ENDSTOP == _E2DIAG_
#define X2_MAX_PIN E2_DIAG_PIN
#elif X2_USE_ENDSTOP == _E3DIAG_
#define X2_MAX_PIN E3_DIAG_PIN
#elif X2_USE_ENDSTOP == _E4DIAG_
#define X2_MAX_PIN E4_DIAG_PIN
#elif X2_USE_ENDSTOP == _E5DIAG_
#define X2_MAX_PIN E5_DIAG_PIN
#elif X2_USE_ENDSTOP == _E6DIAG_
#define X2_MAX_PIN E6_DIAG_PIN
#elif X2_USE_ENDSTOP == _E7DIAG_
#define X2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#else
#ifndef X2_MIN_PIN
#if PIN_EXISTS(X2_STOP)
#define X2_MIN_PIN X2_STOP_PIN
#elif X2_USE_ENDSTOP == _XMIN_
#define X2_MIN_PIN X_MIN_PIN
#elif X2_USE_ENDSTOP == _XMAX_
#define X2_MIN_PIN X_MAX_PIN
#elif X2_USE_ENDSTOP == _XSTOP_
#define X2_MIN_PIN X_STOP_PIN
#elif X2_USE_ENDSTOP == _YMIN_
#define X2_MIN_PIN Y_MIN_PIN
#elif X2_USE_ENDSTOP == _YMAX_
#define X2_MIN_PIN Y_MAX_PIN
#elif X2_USE_ENDSTOP == _YSTOP_
#define X2_MIN_PIN Y_STOP_PIN
#elif X2_USE_ENDSTOP == _ZMIN_
#define X2_MIN_PIN Z_MIN_PIN
#elif X2_USE_ENDSTOP == _ZMAX_
#define X2_MIN_PIN Z_MAX_PIN
#elif X2_USE_ENDSTOP == _ZSTOP_
#define X2_MIN_PIN Z_STOP_PIN
#elif X2_USE_ENDSTOP == _XDIAG_
#define X2_MIN_PIN X_DIAG_PIN
#elif X2_USE_ENDSTOP == _YDIAG_
#define X2_MIN_PIN Y_DIAG_PIN
#elif X2_USE_ENDSTOP == _ZDIAG_
#define X2_MIN_PIN Z_DIAG_PIN
#elif X2_USE_ENDSTOP == _E0DIAG_
#define X2_MIN_PIN E0_DIAG_PIN
#elif X2_USE_ENDSTOP == _E1DIAG_
#define X2_MIN_PIN E1_DIAG_PIN
#elif X2_USE_ENDSTOP == _E2DIAG_
#define X2_MIN_PIN E2_DIAG_PIN
#elif X2_USE_ENDSTOP == _E3DIAG_
#define X2_MIN_PIN E3_DIAG_PIN
#elif X2_USE_ENDSTOP == _E4DIAG_
#define X2_MIN_PIN E4_DIAG_PIN
#elif X2_USE_ENDSTOP == _E5DIAG_
#define X2_MIN_PIN E5_DIAG_PIN
#elif X2_USE_ENDSTOP == _E6DIAG_
#define X2_MIN_PIN E6_DIAG_PIN
#elif X2_USE_ENDSTOP == _E7DIAG_
#define X2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#endif
#endif
/**
* Y_DUAL_ENDSTOPS endstop reassignment
*/
#if ENABLED(Y_DUAL_ENDSTOPS)
#if Y_HOME_TO_MAX
#ifndef Y2_MAX_PIN
#if PIN_EXISTS(Y2_STOP)
#define Y2_MAX_PIN Y2_STOP_PIN
#elif Y2_USE_ENDSTOP == _XMIN_
#define Y2_MAX_PIN X_MIN_PIN
#elif Y2_USE_ENDSTOP == _XMAX_
#define Y2_MAX_PIN X_MAX_PIN
#elif Y2_USE_ENDSTOP == _XSTOP_
#define Y2_MAX_PIN X_STOP_PIN
#elif Y2_USE_ENDSTOP == _YMIN_
#define Y2_MAX_PIN Y_MIN_PIN
#elif Y2_USE_ENDSTOP == _YMAX_
#define Y2_MAX_PIN Y_MAX_PIN
#elif Y2_USE_ENDSTOP == _YSTOP_
#define Y2_MAX_PIN Y_STOP_PIN
#elif Y2_USE_ENDSTOP == _ZMIN_
#define Y2_MAX_PIN Z_MIN_PIN
#elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MAX_PIN Z_MAX_PIN
#elif Y2_USE_ENDSTOP == _ZSTOP_
#define Y2_MAX_PIN Z_STOP_PIN
#elif Y2_USE_ENDSTOP == _XDIAG_
#define Y2_MAX_PIN X_DIAG_PIN
#elif Y2_USE_ENDSTOP == _YDIAG_
#define Y2_MAX_PIN Y_DIAG_PIN
#elif Y2_USE_ENDSTOP == _ZDIAG_
#define Y2_MAX_PIN Z_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E0DIAG_
#define Y2_MAX_PIN E0_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E1DIAG_
#define Y2_MAX_PIN E1_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E2DIAG_
#define Y2_MAX_PIN E2_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E3DIAG_
#define Y2_MAX_PIN E3_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E4DIAG_
#define Y2_MAX_PIN E4_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E5DIAG_
#define Y2_MAX_PIN E5_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E6DIAG_
#define Y2_MAX_PIN E6_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E7DIAG_
#define Y2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#else
#ifndef Y2_MIN_PIN
#if PIN_EXISTS(Y2_STOP)
#define Y2_MIN_PIN Y2_STOP_PIN
#elif Y2_USE_ENDSTOP == _XMIN_
#define Y2_MIN_PIN X_MIN_PIN
#elif Y2_USE_ENDSTOP == _XMAX_
#define Y2_MIN_PIN X_MAX_PIN
#elif Y2_USE_ENDSTOP == _XSTOP_
#define Y2_MIN_PIN X_STOP_PIN
#elif Y2_USE_ENDSTOP == _YMIN_
#define Y2_MIN_PIN Y_MIN_PIN
#elif Y2_USE_ENDSTOP == _YMAX_
#define Y2_MIN_PIN Y_MAX_PIN
#elif Y2_USE_ENDSTOP == _YSTOP_
#define Y2_MIN_PIN Y_STOP_PIN
#elif Y2_USE_ENDSTOP == _ZMIN_
#define Y2_MIN_PIN Z_MIN_PIN
#elif Y2_USE_ENDSTOP == _ZMAX_
#define Y2_MIN_PIN Z_MAX_PIN
#elif Y2_USE_ENDSTOP == _ZSTOP_
#define Y2_MIN_PIN Z_STOP_PIN
#elif Y2_USE_ENDSTOP == _XDIAG_
#define Y2_MIN_PIN X_DIAG_PIN
#elif Y2_USE_ENDSTOP == _YDIAG_
#define Y2_MIN_PIN Y_DIAG_PIN
#elif Y2_USE_ENDSTOP == _ZDIAG_
#define Y2_MIN_PIN Z_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E0DIAG_
#define Y2_MIN_PIN E0_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E1DIAG_
#define Y2_MIN_PIN E1_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E2DIAG_
#define Y2_MIN_PIN E2_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E3DIAG_
#define Y2_MIN_PIN E3_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E4DIAG_
#define Y2_MIN_PIN E4_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E5DIAG_
#define Y2_MIN_PIN E5_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E6DIAG_
#define Y2_MIN_PIN E6_DIAG_PIN
#elif Y2_USE_ENDSTOP == _E7DIAG_
#define Y2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#endif
#endif
/**
* Z_MULTI_ENDSTOPS endstop reassignment
*/
#if ENABLED(Z_MULTI_ENDSTOPS)
#if Z_HOME_TO_MAX
#ifndef Z2_MAX_PIN
#if PIN_EXISTS(Z2_STOP)
#define Z2_MAX_PIN Z2_STOP_PIN
#elif Z2_USE_ENDSTOP == _XMIN_
#define Z2_MAX_PIN X_MIN_PIN
#elif Z2_USE_ENDSTOP == _XMAX_
#define Z2_MAX_PIN X_MAX_PIN
#elif Z2_USE_ENDSTOP == _XSTOP_
#define Z2_MAX_PIN X_STOP_PIN
#elif Z2_USE_ENDSTOP == _YMIN_
#define Z2_MAX_PIN Y_MIN_PIN
#elif Z2_USE_ENDSTOP == _YMAX_
#define Z2_MAX_PIN Y_MAX_PIN
#elif Z2_USE_ENDSTOP == _YSTOP_
#define Z2_MAX_PIN Y_STOP_PIN
#elif Z2_USE_ENDSTOP == _ZMIN_
#define Z2_MAX_PIN Z_MIN_PIN
#elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MAX_PIN Z_MAX_PIN
#elif Z2_USE_ENDSTOP == _ZSTOP_
#define Z2_MAX_PIN Z_STOP_PIN
#elif Z2_USE_ENDSTOP == _XDIAG_
#define Z2_MAX_PIN X_DIAG_PIN
#elif Z2_USE_ENDSTOP == _YDIAG_
#define Z2_MAX_PIN Y_DIAG_PIN
#elif Z2_USE_ENDSTOP == _ZDIAG_
#define Z2_MAX_PIN Z_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E0DIAG_
#define Z2_MAX_PIN E0_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E1DIAG_
#define Z2_MAX_PIN E1_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E2DIAG_
#define Z2_MAX_PIN E2_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E3DIAG_
#define Z2_MAX_PIN E3_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E4DIAG_
#define Z2_MAX_PIN E4_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E5DIAG_
#define Z2_MAX_PIN E5_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E6DIAG_
#define Z2_MAX_PIN E6_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E7DIAG_
#define Z2_MAX_PIN E7_DIAG_PIN
#endif
#endif
#else
#ifndef Z2_MIN_PIN
#if PIN_EXISTS(Z2_STOP)
#define Z2_MIN_PIN Z2_STOP_PIN
#elif Z2_USE_ENDSTOP == _XMIN_
#define Z2_MIN_PIN X_MIN_PIN
#elif Z2_USE_ENDSTOP == _XMAX_
#define Z2_MIN_PIN X_MAX_PIN
#elif Z2_USE_ENDSTOP == _XSTOP_
#define Z2_MIN_PIN X_STOP_PIN
#elif Z2_USE_ENDSTOP == _YMIN_
#define Z2_MIN_PIN Y_MIN_PIN
#elif Z2_USE_ENDSTOP == _YMAX_
#define Z2_MIN_PIN Y_MAX_PIN
#elif Z2_USE_ENDSTOP == _YSTOP_
#define Z2_MIN_PIN Y_STOP_PIN
#elif Z2_USE_ENDSTOP == _ZMIN_
#define Z2_MIN_PIN Z_MIN_PIN
#elif Z2_USE_ENDSTOP == _ZMAX_
#define Z2_MIN_PIN Z_MAX_PIN
#elif Z2_USE_ENDSTOP == _ZSTOP_
#define Z2_MIN_PIN Z_STOP_PIN
#elif Z2_USE_ENDSTOP == _XDIAG_
#define Z2_MIN_PIN X_DIAG_PIN
#elif Z2_USE_ENDSTOP == _YDIAG_
#define Z2_MIN_PIN Y_DIAG_PIN
#elif Z2_USE_ENDSTOP == _ZDIAG_
#define Z2_MIN_PIN Z_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E0DIAG_
#define Z2_MIN_PIN E0_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E1DIAG_
#define Z2_MIN_PIN E1_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E2DIAG_
#define Z2_MIN_PIN E2_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E3DIAG_
#define Z2_MIN_PIN E3_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E4DIAG_
#define Z2_MIN_PIN E4_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E5DIAG_
#define Z2_MIN_PIN E5_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E6DIAG_
#define Z2_MIN_PIN E6_DIAG_PIN
#elif Z2_USE_ENDSTOP == _E7DIAG_
#define Z2_MIN_PIN E7_DIAG_PIN
#endif
#endif
#endif
#if NUM_Z_STEPPERS >= 3
#if Z_HOME_TO_MAX
#ifndef Z3_MAX_PIN
#if PIN_EXISTS(Z3_STOP)
#define Z3_MAX_PIN Z3_STOP_PIN
#elif Z3_USE_ENDSTOP == _XMIN_
#define Z3_MAX_PIN X_MIN_PIN
#elif Z3_USE_ENDSTOP == _XMAX_
#define Z3_MAX_PIN X_MAX_PIN
#elif Z3_USE_ENDSTOP == _XSTOP_
#define Z3_MAX_PIN X_STOP_PIN
#elif Z3_USE_ENDSTOP == _YMIN_
#define Z3_MAX_PIN Y_MIN_PIN
#elif Z3_USE_ENDSTOP == _YMAX_
#define Z3_MAX_PIN Y_MAX_PIN
#elif Z3_USE_ENDSTOP == _YSTOP_
#define Z3_MAX_PIN Y_STOP_PIN
#elif Z3_USE_ENDSTOP == _ZMIN_
#define Z3_MAX_PIN Z_MIN_PIN
#elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MAX_PIN Z_MAX_PIN
#elif Z3_USE_ENDSTOP == _ZSTOP_
#define Z3_MAX_PIN Z_STOP_PIN
#elif Z3_USE_ENDSTOP == _XDIAG_
#define Z3_MAX_PIN X_DIAG_PIN
#elif Z3_USE_ENDSTOP == _YDIAG_
#define Z3_MAX_PIN Y_DIAG_PIN
#elif Z3_USE_ENDSTOP == _ZDIAG_
#define Z3_MAX_PIN Z_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E0DIAG_
#define Z3_MAX_PIN E0_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E1DIAG_
#define Z3_MAX_PIN E1_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E2DIAG_
#define Z3_MAX_PIN E2_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E3DIAG_
#define Z3_MAX_PIN E3_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E4DIAG_
#define Z3_MAX_PIN E4_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E5DIAG_
#define Z3_MAX_PIN E5_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E6DIAG_
#define Z3_MAX_PIN E6_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E7DIAG_
#define Z3_MAX_PIN E7_DIAG_PIN
#endif
#endif
#else
#ifndef Z3_MIN_PIN
#if PIN_EXISTS(Z3_STOP)
#define Z3_MIN_PIN Z3_STOP_PIN
#elif Z3_USE_ENDSTOP == _XMIN_
#define Z3_MIN_PIN X_MIN_PIN
#elif Z3_USE_ENDSTOP == _XMAX_
#define Z3_MIN_PIN X_MAX_PIN
#elif Z3_USE_ENDSTOP == _XSTOP_
#define Z3_MIN_PIN X_STOP_PIN
#elif Z3_USE_ENDSTOP == _YMIN_
#define Z3_MIN_PIN Y_MIN_PIN
#elif Z3_USE_ENDSTOP == _YMAX_
#define Z3_MIN_PIN Y_MAX_PIN
#elif Z3_USE_ENDSTOP == _YSTOP_
#define Z3_MIN_PIN Y_STOP_PIN
#elif Z3_USE_ENDSTOP == _ZMIN_
#define Z3_MIN_PIN Z_MIN_PIN
#elif Z3_USE_ENDSTOP == _ZMAX_
#define Z3_MIN_PIN Z_MAX_PIN
#elif Z3_USE_ENDSTOP == _ZSTOP_
#define Z3_MIN_PIN Z_STOP_PIN
#elif Z3_USE_ENDSTOP == _XDIAG_
#define Z3_MIN_PIN X_DIAG_PIN
#elif Z3_USE_ENDSTOP == _YDIAG_
#define Z3_MIN_PIN Y_DIAG_PIN
#elif Z3_USE_ENDSTOP == _ZDIAG_
#define Z3_MIN_PIN Z_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E0DIAG_
#define Z3_MIN_PIN E0_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E1DIAG_
#define Z3_MIN_PIN E1_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E2DIAG_
#define Z3_MIN_PIN E2_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E3DIAG_
#define Z3_MIN_PIN E3_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E4DIAG_
#define Z3_MIN_PIN E4_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E5DIAG_
#define Z3_MIN_PIN E5_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E6DIAG_
#define Z3_MIN_PIN E6_DIAG_PIN
#elif Z3_USE_ENDSTOP == _E7DIAG_
#define Z3_MIN_PIN E7_DIAG_PIN
#endif
#endif
#endif
#endif
#if NUM_Z_STEPPERS >= 4
#if Z_HOME_TO_MAX
#ifndef Z4_MAX_PIN
#if PIN_EXISTS(Z4_STOP)
#define Z4_MAX_PIN Z4_STOP_PIN
#elif Z4_USE_ENDSTOP == _XMIN_
#define Z4_MAX_PIN X_MIN_PIN
#elif Z4_USE_ENDSTOP == _XMAX_
#define Z4_MAX_PIN X_MAX_PIN
#elif Z4_USE_ENDSTOP == _XSTOP_
#define Z4_MAX_PIN X_STOP_PIN
#elif Z4_USE_ENDSTOP == _YMIN_
#define Z4_MAX_PIN Y_MIN_PIN
#elif Z4_USE_ENDSTOP == _YMAX_
#define Z4_MAX_PIN Y_MAX_PIN
#elif Z4_USE_ENDSTOP == _YSTOP_
#define Z4_MAX_PIN Y_STOP_PIN
#elif Z4_USE_ENDSTOP == _ZMIN_
#define Z4_MAX_PIN Z_MIN_PIN
#elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MAX_PIN Z_MAX_PIN
#elif Z4_USE_ENDSTOP == _ZSTOP_
#define Z4_MAX_PIN Z_STOP_PIN
#elif Z4_USE_ENDSTOP == _XDIAG_
#define Z4_MAX_PIN X_DIAG_PIN
#elif Z4_USE_ENDSTOP == _YDIAG_
#define Z4_MAX_PIN Y_DIAG_PIN
#elif Z4_USE_ENDSTOP == _ZDIAG_
#define Z4_MAX_PIN Z_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E0DIAG_
#define Z4_MAX_PIN E0_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E1DIAG_
#define Z4_MAX_PIN E1_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E2DIAG_
#define Z4_MAX_PIN E2_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E3DIAG_
#define Z4_MAX_PIN E3_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E4DIAG_
#define Z4_MAX_PIN E4_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E5DIAG_
#define Z4_MAX_PIN E5_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E6DIAG_
#define Z4_MAX_PIN E6_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E7DIAG_
#define Z4_MAX_PIN E7_DIAG_PIN
#endif
#endif
#else
#ifndef Z4_MIN_PIN
#if PIN_EXISTS(Z4_STOP)
#define Z4_MIN_PIN Z4_STOP_PIN
#elif Z4_USE_ENDSTOP == _XMIN_
#define Z4_MIN_PIN X_MIN_PIN
#elif Z4_USE_ENDSTOP == _XMAX_
#define Z4_MIN_PIN X_MAX_PIN
#elif Z4_USE_ENDSTOP == _XSTOP_
#define Z4_MIN_PIN X_STOP_PIN
#elif Z4_USE_ENDSTOP == _YMIN_
#define Z4_MIN_PIN Y_MIN_PIN
#elif Z4_USE_ENDSTOP == _YMAX_
#define Z4_MIN_PIN Y_MAX_PIN
#elif Z4_USE_ENDSTOP == _YSTOP_
#define Z4_MIN_PIN Y_STOP_PIN
#elif Z4_USE_ENDSTOP == _ZMIN_
#define Z4_MIN_PIN Z_MIN_PIN
#elif Z4_USE_ENDSTOP == _ZMAX_
#define Z4_MIN_PIN Z_MAX_PIN
#elif Z4_USE_ENDSTOP == _ZSTOP_
#define Z4_MIN_PIN Z_STOP_PIN
#elif Z4_USE_ENDSTOP == _XDIAG_
#define Z4_MIN_PIN X_DIAG_PIN
#elif Z4_USE_ENDSTOP == _YDIAG_
#define Z4_MIN_PIN Y_DIAG_PIN
#elif Z4_USE_ENDSTOP == _ZDIAG_
#define Z4_MIN_PIN Z_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E0DIAG_
#define Z4_MIN_PIN E0_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E1DIAG_
#define Z4_MIN_PIN E1_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E2DIAG_
#define Z4_MIN_PIN E2_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E3DIAG_
#define Z4_MIN_PIN E3_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E4DIAG_
#define Z4_MIN_PIN E4_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E5DIAG_
#define Z4_MIN_PIN E5_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E6DIAG_
#define Z4_MIN_PIN E6_DIAG_PIN
#elif Z4_USE_ENDSTOP == _E7DIAG_
#define Z4_MIN_PIN E7_DIAG_PIN
#endif
#endif
#endif
#endif
#endif // Z_MULTI_ENDSTOPS
//
// Default DOGLCD SPI delays
//

View File

@ -233,16 +233,22 @@
#define HEATER_0_PIN MOSFET_A_PIN
#if FET_ORDER_EFB // Hotend, Fan, Bed
#define HEATER_BED_PIN MOSFET_C_PIN
#ifndef HEATER_BED_PIN
#define HEATER_BED_PIN MOSFET_C_PIN
#endif
#elif FET_ORDER_EEF // Hotend, Hotend, Fan
#define HEATER_1_PIN MOSFET_B_PIN
#elif FET_ORDER_EEB // Hotend, Hotend, Bed
#define HEATER_1_PIN MOSFET_B_PIN
#define HEATER_BED_PIN MOSFET_C_PIN
#ifndef HEATER_BED_PIN
#define HEATER_BED_PIN MOSFET_C_PIN
#endif
#elif FET_ORDER_EFF // Hotend, Fan, Fan
#define FAN1_PIN MOSFET_C_PIN
#elif DISABLED(FET_ORDER_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE")
#define HEATER_BED_PIN MOSFET_C_PIN
#ifndef HEATER_BED_PIN
#define HEATER_BED_PIN MOSFET_C_PIN
#endif
#if EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL)
#define HEATER_1_PIN MOSFET_D_PIN
#else

View File

@ -40,78 +40,94 @@
//
// PWM FETS
//
#if EITHER(FET_ORDER_EEF, FET_ORDER_EEB)
#define MOSFET_B_PIN 45 // HEATER1
#elif FET_ORDER_EFB
#define MOSFET_B_PIN 9 // FAN0
#else
#define MOSFET_B_PIN 7 // FAN1
#endif
#if FET_ORDER_EEB
#define MOSFET_C_PIN 8 // BED
#elif FET_ORDER_EFB
#if DISABLED(ANYCUBIC_LCD_CHIRON)
#define MOSFET_C_PIN 8
#else
#define MOSFET_C_PIN 45
#endif
#else // EEF, EFF
#define MOSFET_C_PIN 9
#endif
#if FET_ORDER_EEB
#define FAN_PIN 9 // Override pin 4 in pins_RAMPS.h
#endif
#define MOSFET_B_PIN 45 // HEATER1
//
// Heaters / Fans
//
#if ANY(FET_ORDER_EEF, FET_ORDER_EEB, FET_ORDER_EFB)
#define FAN1_PIN 7
#endif
#define FAN2_PIN 44
#define FAN_PIN 9 // FAN0
#define FAN1_PIN 7 // FAN1
#define FAN2_PIN 44 // FAN2
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 44 // Used in Anycubic Kossel example config
#endif
#if ENABLED(ANYCUBIC_LCD_I3MEGA)
#define CONTROLLER_FAN_PIN 7
#define E0_AUTO_FAN_PIN FAN2_PIN
#endif
//
// AnyCubic standard pin mappings
// AnyCubic pin mappings
//
// Define the appropriate mapping option in Configuration.h:
// - TRIGORILLA_MAPPING_CHIRON
// - TRIGORILLA_MAPPING_I3MEGA
//
// On most printers, endstops are NOT all wired to the appropriate pins on the Trigorilla board.
// For instance, on a Chiron, Y axis goes to an aux connector.
// There are also other things that have been wired in creative ways.
// To enable PIN definitions for a specific printer model, #define the appropriate symbol after
// MOTHERBOARD in Configuration.h
//
// Limit Switches
//
//#define ANYCUBIC_4_MAX_PRO_ENDSTOPS
#if ENABLED(ANYCUBIC_4_MAX_PRO_ENDSTOPS)
#define X_MAX_PIN 43
#define Y_STOP_PIN 19
#elif EITHER(ANYCUBIC_LCD_CHIRON, ANYCUBIC_LCD_I3MEGA)
#define Y_STOP_PIN 42
#define Z2_MIN_PIN 43
#elif EITHER(TRIGORILLA_MAPPING_CHIRON, TRIGORILLA_MAPPING_I3MEGA)
// Chiron uses AUX header for Y and Z endstops
#define Y_STOP_PIN 42 // AUX
#define Z_STOP_PIN 43 // AUX
#define Z2_MIN_PIN 18 // Z-
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 2
#endif
#ifndef FIL_RUNOUT_PIN
#if ENABLED(ANYCUBIC_LCD_CHIRON)
#define CONTROLLER_FAN_PIN FAN1_PIN
#if ENABLED(POWER_LOSS_RECOVERY)
#define OUTAGETEST_PIN 79
#define OUTAGECON_PIN 58
#endif
#if ENABLED(TRIGORILLA_MAPPING_CHIRON)
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 33
#else
#endif
// Chiron swaps the Z stepper connections
#define Z_STEP_PIN 36
#define Z_DIR_PIN 34
#define Z_ENABLE_PIN 30
#define Z_CS_PIN 44
#define Z2_STEP_PIN 46
#define Z2_DIR_PIN 48
#define Z2_ENABLE_PIN 62
#define Z2_CS_PIN 40
#define HEATER_BED_PIN MOSFET_B_PIN // HEATER1
#else
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 19
#endif
#endif
#endif
#if EITHER(ANYCUBIC_LCD_CHIRON, ANYCUBIC_LCD_I3MEGA)
#define BEEPER_PIN 31
#define SD_DETECT_PIN 49
#endif
#if HAS_TMC_UART
#ifndef X_SERIAL_TX_PIN
#define X_SERIAL_TX_PIN SERVO1_PIN
#endif
#ifndef Y_SERIAL_TX_PIN
#define Y_SERIAL_TX_PIN SERVO0_PIN
#endif
#ifndef Z_SERIAL_TX_PIN
#define Z_SERIAL_TX_PIN SERVO3_PIN
#endif
#ifndef E0_SERIAL_TX_PIN
#define E0_SERIAL_TX_PIN SERVO2_PIN
#endif
#endif
#include "pins_RAMPS.h"
//