More reduction, cleanup

This commit is contained in:
Scott Lahteine 2020-11-10 23:28:50 -06:00
parent 59cc4fee67
commit 2235a6d89d
7 changed files with 95 additions and 210 deletions

View file

@ -1187,28 +1187,26 @@
#define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500. #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
//#define DISTINCT_FIL_RUNOUT_STATES // Enable if runout sensors need distinct settings #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
#if DISABLED(DISTINCT_FIL_RUNOUT_STATES) #define FIL_RUNOUT_PULL // Use internal pullup / pulldown for filament runout pins.
#define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
#define FIL_RUNOUT_PULL // Use internal pullup / pulldown for filament runout pins. // Override individually if the runout sensors vary
#else //#define FIL_RUNOUT1_STATE LOW
#define FIL_RUNOUT1_STATE LOW //#define FIL_RUNOUT1_PULL
#define FIL_RUNOUT1_PULL //#define FIL_RUNOUT2_STATE LOW
#define FIL_RUNOUT2_STATE LOW //#define FIL_RUNOUT2_PULL
#define FIL_RUNOUT2_PULL //#define FIL_RUNOUT3_STATE LOW
//#define FIL_RUNOUT3_STATE LOW //#define FIL_RUNOUT3_PULL
//#define FIL_RUNOUT3_PULL //#define FIL_RUNOUT4_STATE LOW
//#define FIL_RUNOUT4_STATE LOW //#define FIL_RUNOUT4_PULL
//#define FIL_RUNOUT4_PULL //#define FIL_RUNOUT5_STATE LOW
//#define FIL_RUNOUT5_STATE LOW //#define FIL_RUNOUT5_PULL
//#define FIL_RUNOUT5_PULL //#define FIL_RUNOUT6_STATE LOW
//#define FIL_RUNOUT6_STATE LOW //#define FIL_RUNOUT6_PULL
//#define FIL_RUNOUT6_PULL //#define FIL_RUNOUT7_STATE LOW
//#define FIL_RUNOUT7_STATE LOW //#define FIL_RUNOUT7_PULL
//#define FIL_RUNOUT7_PULL //#define FIL_RUNOUT8_STATE LOW
//#define FIL_RUNOUT8_STATE LOW //#define FIL_RUNOUT8_PULL
//#define FIL_RUNOUT8_PULL
#endif
// Set one or more commands to execute on filament runout. // Set one or more commands to execute on filament runout.
// (After 'M412 H' Marlin will ask the host to handle the process.) // (After 'M412 H' Marlin will ask the host to handle the process.)

View file

@ -150,7 +150,7 @@ class FilamentSensorBase {
public: public:
static inline void setup() { static inline void setup() {
#define _INIT_RUNOUT_PIN(N,P) do{ if (DISABLED(FIL_RUNOUT##N##_PULL)) SET_INPUT(P) else if (FIL_RUNOUT##N##_STATE) SET_INPUT_PULLDOWN(P); else SET_INPUT_PULLUP(P); }while(0) #define _INIT_RUNOUT_PIN(N,P) do{ if (DISABLED(FIL_RUNOUT##N##_PULL)) SET_INPUT(P) else if (FIL_RUNOUT##N##_STATE) SET_INPUT_PULLDOWN(P); else SET_INPUT_PULLUP(P); }while(0)
#define INIT_RUNOUT_PIN(N,P) _INIT_RUNOUT_PIN(TERN_(DISTINCT_FIL_RUNOUT_STATES, N),P) #define INIT_RUNOUT_PIN(N,P) _INIT_RUNOUT_PIN(N,P)
#if NUM_RUNOUT_SENSORS >= 1 #if NUM_RUNOUT_SENSORS >= 1
INIT_RUNOUT_PIN(1, P) INIT_RUNOUT_PIN(1, P)
#endif #endif
@ -176,7 +176,7 @@ class FilamentSensorBase {
INIT_RUNOUT_PIN(8, P) INIT_RUNOUT_PIN(8, P)
#endif #endif
#undef _INIT_RUNOUT_PIN #undef _INIT_RUNOUT_PIN
#undef INIT_RUNOUT_PIN #undef INIT_RUNOUT_PIN
} }
// Return a bitmask of runout pin states // Return a bitmask of runout pin states
@ -189,33 +189,29 @@ class FilamentSensorBase {
// Return a bitmask of runout flag states (1 bits always indicates runout) // Return a bitmask of runout flag states (1 bits always indicates runout)
static inline uint8_t poll_runout_states() { static inline uint8_t poll_runout_states() {
return poll_runout_pins() ^ uint8_t(0 return poll_runout_pins() ^ uint8_t(0
#if ENABLED(DISTINCT_FIL_RUNOUT_STATES) #if NUM_RUNOUT_SENSORS >= 1
#if NUM_RUNOUT_SENSORS >= 1 | (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1))
| (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1)) #endif
#endif #if NUM_RUNOUT_SENSORS >= 2
#if NUM_RUNOUT_SENSORS >= 2 | (FIL_RUNOUT2_STATE ? 0 : _BV(2 - 1))
| (FIL_RUNOUT2_STATE ? 0 : _BV(2 - 1)) #endif
#endif #if NUM_RUNOUT_SENSORS >= 3
#if NUM_RUNOUT_SENSORS >= 3 | (FIL_RUNOUT3_STATE ? 0 : _BV(3 - 1))
| (FIL_RUNOUT3_STATE ? 0 : _BV(3 - 1)) #endif
#endif #if NUM_RUNOUT_SENSORS >= 4
#if NUM_RUNOUT_SENSORS >= 4 | (FIL_RUNOUT4_STATE ? 0 : _BV(4 - 1))
| (FIL_RUNOUT4_STATE ? 0 : _BV(4 - 1)) #endif
#endif #if NUM_RUNOUT_SENSORS >= 5
#if NUM_RUNOUT_SENSORS >= 5 | (FIL_RUNOUT5_STATE ? 0 : _BV(5 - 1))
| (FIL_RUNOUT5_STATE ? 0 : _BV(5 - 1)) #endif
#endif #if NUM_RUNOUT_SENSORS >= 6
#if NUM_RUNOUT_SENSORS >= 6 | (FIL_RUNOUT6_STATE ? 0 : _BV(6 - 1))
| (FIL_RUNOUT6_STATE ? 0 : _BV(6 - 1)) #endif
#endif #if NUM_RUNOUT_SENSORS >= 7
#if NUM_RUNOUT_SENSORS >= 7 | (FIL_RUNOUT7_STATE ? 0 : _BV(7 - 1))
| (FIL_RUNOUT7_STATE ? 0 : _BV(7 - 1)) #endif
#endif #if NUM_RUNOUT_SENSORS >= 8
#if NUM_RUNOUT_SENSORS >= 8 | (FIL_RUNOUT8_STATE ? 0 : _BV(8 - 1))
| (FIL_RUNOUT8_STATE ? 0 : _BV(8 - 1))
#endif
#else // !DISTINCT_FIL_RUNOUT_STATES
| (FIL_RUNOUT_STATE ? 0 : _BV(NUM_RUNOUT_SENSORS) - 1)
#endif #endif
); );
} }

View file

@ -675,162 +675,78 @@
#define HAS_BED_PROBE 1 #define HAS_BED_PROBE 1
#endif #endif
#if ENABLED(DISTINCT_FIL_RUNOUT_STATES) #if ENABLED(FILAMENT_RUNOUT_SENSOR)
#ifndef FIL_RUNOUT1_STATE #if ANY(FIL_RUNOUT1_STATE, FIL_RUNOUT1_PULL, FIL_RUNOUT2_STATE, FIL_RUNOUT2_PULL, \
#define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE FIL_RUNOUT3_STATE, FIL_RUNOUT3_PULL, FIL_RUNOUT4_STATE, FIL_RUNOUT4_PULL, \
FIL_RUNOUT5_STATE, FIL_RUNOUT5_PULL, FIL_RUNOUT6_STATE, FIL_RUNOUT6_PULL, \
FIL_RUNOUT7_STATE, FIL_RUNOUT7_PULL, FIL_RUNOUT8_STATE, FIL_RUNOUT8_PULL )
#define DISTINCT_FIL_RUNOUT_STATES 1
#endif #endif
#if NUM_RUNOUT_SENSORS > 1 #if NUM_RUNOUT_SENSORS >= 1
#ifndef FIL_RUNOUT1_STATE
#define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT1_PULL
#define FIL_RUNOUT1_PULL FIL_RUNOUT_PULL
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 2
#ifndef FIL_RUNOUT2_STATE #ifndef FIL_RUNOUT2_STATE
#define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE #define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE
#endif #endif
#ifndef FIL_RUNOUT2_PULL
#define FIL_RUNOUT2_PULL FIL_RUNOUT_PULL
#endif
#endif #endif
#if NUM_RUNOUT_SENSORS > 2 #if NUM_RUNOUT_SENSORS >= 3
#ifndef FIL_RUNOUT3_STATE #ifndef FIL_RUNOUT3_STATE
#define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE #define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE
#endif #endif
#ifndef FIL_RUNOUT3_PULL
#define FIL_RUNOUT3_PULL FIL_RUNOUT_PULL
#endif
#endif #endif
#if NUM_RUNOUT_SENSORS > 3 #if NUM_RUNOUT_SENSORS >= 4
#ifndef FIL_RUNOUT4_STATE #ifndef FIL_RUNOUT4_STATE
#define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE #define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE
#endif #endif
#ifndef FIL_RUNOUT4_PULL
#define FIL_RUNOUT4_PULL FIL_RUNOUT_PULL
#endif
#endif #endif
#if NUM_RUNOUT_SENSORS > 4 #if NUM_RUNOUT_SENSORS >= 5
#ifndef FIL_RUNOUT5_STATE #ifndef FIL_RUNOUT5_STATE
#define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE #define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE
#endif #endif
#ifndef FIL_RUNOUT5_PULL
#define FIL_RUNOUT5_PULL FIL_RUNOUT_PULL
#endif
#endif #endif
#if NUM_RUNOUT_SENSORS > 5 #if NUM_RUNOUT_SENSORS >= 6
#ifndef FIL_RUNOUT6_STATE #ifndef FIL_RUNOUT6_STATE
#define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE #define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE
#endif #endif
#ifndef FIL_RUNOUT6_PULL
#define FIL_RUNOUT6_PULL FIL_RUNOUT_PULL
#endif
#endif #endif
#if NUM_RUNOUT_SENSORS > 6 #if NUM_RUNOUT_SENSORS >= 7
#ifndef FIL_RUNOUT7_STATE #ifndef FIL_RUNOUT7_STATE
#define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE #define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE
#endif #endif
#ifndef FIL_RUNOUT7_PULL
#define FIL_RUNOUT7_PULL FIL_RUNOUT_PULL
#endif
#endif #endif
#if NUM_RUNOUT_SENSORS > 7 #if NUM_RUNOUT_SENSORS >= 8
#ifndef FIL_RUNOUT8_STATE #ifndef FIL_RUNOUT8_STATE
#define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE #define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE
#endif #endif
#ifndef FIL_RUNOUT8_PULL
#define FIL_RUNOUT8_PULL FIL_RUNOUT_PULL
#endif
#endif #endif
#if EITHER(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN) #endif // FILAMENT_RUNOUT_SENSOR
#if ENABLED(FIL_RUNOUT_PULLUP)
#if NONE(FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN)
#define FIL_RUNOUT1_PULLUP
#endif
#if NONE(FIL_RUNOUT2_PULLUP, FIL_RUNOUT2_PULLDOWN)
#define FIL_RUNOUT2_PULLUP
#endif
#if NONE(FIL_RUNOUT3_PULLUP, FIL_RUNOUT3_PULLDOWN)
#define FIL_RUNOUT3_PULLUP
#endif
#if NONE(FIL_RUNOUT4_PULLUP, FIL_RUNOUT4_PULLDOWN)
#define FIL_RUNOUT4_PULLUP
#endif
#if NONE(FIL_RUNOUT5_PULLUP, FIL_RUNOUT5_PULLDOWN)
#define FIL_RUNOUT5_PULLUP
#endif
#if NONE(FIL_RUNOUT6_PULLUP, FIL_RUNOUT6_PULLDOWN)
#define FIL_RUNOUT6_PULLUP
#endif
#if NONE(FIL_RUNOUT7_PULLUP, FIL_RUNOUT7_PULLDOWN)
#define FIL_RUNOUT7_PULLUP
#endif
#if NONE(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
#define FIL_RUNOUT8_PULLUP
#endif
#else // !FIL_RUNOUT_PULLUP
#if NONE(FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN)
#define FIL_RUNOUT1_PULLDOWN
#endif
#if NONE(FIL_RUNOUT2_PULLUP, FIL_RUNOUT2_PULLDOWN)
#define FIL_RUNOUT2_PULLDOWN
#endif
#if NONE(FIL_RUNOUT3_PULLUP, FIL_RUNOUT3_PULLDOWN)
#define FIL_RUNOUT3_PULLDOWN
#endif
#if NONE(FIL_RUNOUT4_PULLUP, FIL_RUNOUT4_PULLDOWN)
#define FIL_RUNOUT4_PULLDOWN
#endif
#if NONE(FIL_RUNOUT5_PULLUP, FIL_RUNOUT5_PULLDOWN)
#define FIL_RUNOUT5_PULLDOWN
#endif
#if NONE(FIL_RUNOUT6_PULLUP, FIL_RUNOUT6_PULLDOWN)
#define FIL_RUNOUT6_PULLDOWN
#endif
#if NONE(FIL_RUNOUT7_PULLUP, FIL_RUNOUT7_PULLDOWN)
#define FIL_RUNOUT7_PULLDOWN
#endif
#if NONE(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
#define FIL_RUNOUT8_PULLDOWN
#endif
#endif // FIL_RUNOUT_PULLUP
#endif // FIL_RUNOUT_PULLUP || FIL_RUNOUT_PULLDOWN
#else // !DISTINCT_FIL_RUNOUT_STATES
#undef FIL_RUNOUT1_STATE
#undef FIL_RUNOUT1_PULLUP
#undef FIL_RUNOUT1_PULLDOWN
#define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE
#define FIL_RUNOUT1_PULLUP FIL_RUNOUT_PULLUP
#define FIL_RUNOUT1_PULLDOWN FIL_RUNOUT_PULLDOWN
#undef FIL_RUNOUT2_STATE
#undef FIL_RUNOUT2_PULLUP
#undef FIL_RUNOUT2_PULLDOWN
#if NUM_RUNOUT_SENSORS > 1
#define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE
#define FIL_RUNOUT2_PULLUP FIL_RUNOUT_PULLUP
#define FIL_RUNOUT2_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#undef FIL_RUNOUT3_STATE
#undef FIL_RUNOUT3_PULLUP
#undef FIL_RUNOUT3_PULLDOWN
#if NUM_RUNOUT_SENSORS > 2
#define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE
#define FIL_RUNOUT3_PULLUP FIL_RUNOUT_PULLUP
#define FIL_RUNOUT3_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#undef FIL_RUNOUT4_STATE
#undef FIL_RUNOUT4_PULLUP
#undef FIL_RUNOUT4_PULLDOWN
#if NUM_RUNOUT_SENSORS > 3
#define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE
#define FIL_RUNOUT4_PULLUP FIL_RUNOUT_PULLUP
#define FIL_RUNOUT4_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#undef FIL_RUNOUT5_STATE
#undef FIL_RUNOUT5_PULLUP
#undef FIL_RUNOUT5_PULLDOWN
#if NUM_RUNOUT_SENSORS > 4
#define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE
#define FIL_RUNOUT5_PULLUP FIL_RUNOUT_PULLUP
#define FIL_RUNOUT5_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#undef FIL_RUNOUT6_STATE
#undef FIL_RUNOUT6_PULLUP
#undef FIL_RUNOUT6_PULLDOWN
#if NUM_RUNOUT_SENSORS > 5
#define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE
#define FIL_RUNOUT6_PULLUP FIL_RUNOUT_PULLUP
#define FIL_RUNOUT6_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#undef FIL_RUNOUT7_STATE
#undef FIL_RUNOUT7_PULLUP
#undef FIL_RUNOUT7_PULLDOWN
#if NUM_RUNOUT_SENSORS > 6
#define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE
#define FIL_RUNOUT7_PULLUP FIL_RUNOUT_PULLUP
#define FIL_RUNOUT7_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#undef FIL_RUNOUT8_STATE
#undef FIL_RUNOUT8_PULLUP
#undef FIL_RUNOUT8_PULLDOWN
#if NUM_RUNOUT_SENSORS > 7
#define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE
#define FIL_RUNOUT8_PULLUP FIL_RUNOUT_PULLUP
#define FIL_RUNOUT8_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif // DISTINCT_FIL_RUNOUT_STATES
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
#undef PROBE_MANUALLY #undef PROBE_MANUALLY

View file

@ -111,7 +111,7 @@
#elif defined(FILAMENT_SENSOR) #elif defined(FILAMENT_SENSOR)
#error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration." #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration."
#elif defined(ENDSTOPPULLUP_FIL_RUNOUT) #elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
#error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration." #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULL. Please update your configuration."
#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
#error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
#elif defined(LANGUAGE_INCLUDE) #elif defined(LANGUAGE_INCLUDE)
@ -660,8 +660,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS) #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
#error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS." #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
#elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
#error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
#elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX) #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX)
#error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX." #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
#elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX) #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX)
@ -834,27 +832,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#elif DISABLED(ADVANCED_PAUSE_FEATURE) #elif DISABLED(ADVANCED_PAUSE_FEATURE)
static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR."); static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
#endif #endif
#if ENABLED(DISTINCT_FIL_RUNOUT_STATES)
#if NUM_RUNOUT_SENSORS >= 1 && !defined(FIL_RUNOUT1_STATE)
#error "FIL_RUNOUT1_STATE is required with NUM_RUNOUT_SENSORS >= 2."
#elif NUM_RUNOUT_SENSORS >= 2 && !defined(FIL_RUNOUT2_STATE)
#error "FIL_RUNOUT2_STATE is required with NUM_RUNOUT_SENSORS >= 2."
#elif NUM_RUNOUT_SENSORS >= 3 && !defined(FIL_RUNOUT3_STATE)
#error "FIL_RUNOUT3_STATE is required with NUM_RUNOUT_SENSORS >= 3."
#elif NUM_RUNOUT_SENSORS >= 4 && !defined(FIL_RUNOUT4_STATE)
#error "FIL_RUNOUT4_STATE is required with NUM_RUNOUT_SENSORS >= 4."
#elif NUM_RUNOUT_SENSORS >= 5 && !defined(FIL_RUNOUT5_STATE)
#error "FIL_RUNOUT5_STATE is required with NUM_RUNOUT_SENSORS >= 5."
#elif NUM_RUNOUT_SENSORS >= 6 && !defined(FIL_RUNOUT6_STATE)
#error "FIL_RUNOUT6_STATE is required with NUM_RUNOUT_SENSORS >= 6."
#elif NUM_RUNOUT_SENSORS >= 7 && !defined(FIL_RUNOUT7_STATE)
#error "FIL_RUNOUT7_STATE is required with NUM_RUNOUT_SENSORS >= 7."
#elif NUM_RUNOUT_SENSORS >= 8 && !defined(FIL_RUNOUT8_STATE)
#error "FIL_RUNOUT8_STATE is required with NUM_RUNOUT_SENSORS >= 8."
#endif
#endif
#endif #endif
/** /**

View file

@ -76,8 +76,8 @@ namespace Anycubic {
#endif #endif
// Filament runout is handled by Marlin settings in Configuration.h // Filament runout is handled by Marlin settings in Configuration.h
// set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present. // opt_set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present.
// enable FIL_RUNOUT_PULLUP // opt_enable FIL_RUNOUT_PULL
TFTSer.begin(115200); TFTSer.begin(115200);

View file

@ -24,8 +24,7 @@ opt_set E2_AUTO_FAN_PIN PC12
opt_set X_DRIVER_TYPE TMC2208 opt_set X_DRIVER_TYPE TMC2208
opt_set Y_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2130
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
opt_enable FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE \ opt_enable FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE
DISTINCT_FIL_RUNOUT_STATES ADVANCED_PAUSE_FEATURE
opt_set FIL_RUNOUT_PIN 3 opt_set FIL_RUNOUT_PIN 3
opt_set FIL_RUNOUT2_PIN 4 opt_set FIL_RUNOUT2_PIN 4
opt_set FIL_RUNOUT3_PIN 5 opt_set FIL_RUNOUT3_PIN 5
@ -35,9 +34,9 @@ opt_set FIL_RUNOUT6_PIN 8
opt_set FIL_RUNOUT7_PIN 9 opt_set FIL_RUNOUT7_PIN 9
opt_set FIL_RUNOUT8_PIN 10 opt_set FIL_RUNOUT8_PIN 10
opt_set FIL_RUNOUT4_STATE HIGH opt_set FIL_RUNOUT4_STATE HIGH
opt_enable FIL_RUNOUT4_PULLDOWN opt_enable FIL_RUNOUT4_PULL
opt_set FIL_RUNOUT8_STATE HIGH opt_set FIL_RUNOUT8_STATE HIGH
opt_enable FIL_RUNOUT8_PULLDOWN opt_enable FIL_RUNOUT8_PULL
exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan, Mixed TMC Drivers, and Runout Sensors with distinct states" exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan, Mixed TMC Drivers, and Runout Sensors with distinct states"
restore_configs restore_configs

View file

@ -85,8 +85,7 @@ opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_
AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \
NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \
PRUSA_MMU2 MMU2_MENUS PRUSA_MMU2_S_MODE DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ PRUSA_MMU2 MMU2_MENUS PRUSA_MMU2_S_MODE DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \
FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING \ FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULL
DISTINCT_FIL_RUNOUT_STATES FIL_RUNOUT3_PULLUP
opt_set MIXING_STEPPERS 5 opt_set MIXING_STEPPERS 5
opt_set FIL_RUNOUT3_STATE HIGH opt_set FIL_RUNOUT3_STATE HIGH
exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states" exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states"