From 27a1ba405cbeb30a28d32955bd1b8bb9e21b37ad Mon Sep 17 00:00:00 2001 From: Costas Basdekis Date: Sat, 31 Oct 2020 11:37:41 +0000 Subject: [PATCH] Allow for distinct runout sensor pullup/pulldown You need to define DISTINCT_FIL_RUNOUT_STATES, and then optionally FIL_RUNOUT#_PULLUP or FIL_RUNOUT#_PULLDOWN for each sensor you want to override. --- Marlin/Configuration.h | 30 ++++++++- Marlin/src/feature/runout.h | 106 +++++++++++++++++++++++++++--- Marlin/src/inc/Conditionals_LCD.h | 85 ++++++++++++++++++++++++ Marlin/src/inc/SanityCheck.h | 75 ++++++++++++++++----- 4 files changed, 266 insertions(+), 30 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index bca7a5df50..7474f43cb5 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1176,26 +1176,50 @@ //#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) #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, and optionally a FIL_RUNOUT#_STATE, for each. + #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN, and optionally a FIL_RUNOUT#_STATE/FIL_RUNOUT#_PULLUP/FIL_RUNOUT#_PULLDOWN, for each. #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present. #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. /** * With this option each sensor can have a separate state than the first one. * To override the state for a sensor, up to NUM_RUNOUT_SENSORS, set - * FIL_RUNOUT#_STATE, otherwise FIL_RUNOUT_STATE will be used. + * FIL_RUNOUT#_STATE, otherwise FIL_RUNOUT_STATE will be used. Similarly with + * FIL_RUNOUT#_PULLUP and FIL_RUNOUT#_PULLDOWN. */ //#define DISTINCT_FIL_RUNOUT_STATES #ifdef DISTINCT_FIL_RUNOUT_STATES //#define FIL_RUNOUT1_STATE LOW + //#define FIL_RUNOUT1_PULLUP + //#define FIL_RUNOUT1_PULLDOWN + //#define FIL_RUNOUT2_STATE LOW + //#define FIL_RUNOUT2_PULLUP + //#define FIL_RUNOUT2_PULLDOWN + //#define FIL_RUNOUT3_STATE LOW + //#define FIL_RUNOUT3_PULLUP + //#define FIL_RUNOUT3_PULLDOWN + //#define FIL_RUNOUT4_STATE LOW + //#define FIL_RUNOUT4_PULLUP + //#define FIL_RUNOUT4_PULLDOWN + //#define FIL_RUNOUT5_STATE LOW + //#define FIL_RUNOUT5_PULLUP + //#define FIL_RUNOUT5_PULLDOWN + //#define FIL_RUNOUT6_STATE LOW + //#define FIL_RUNOUT6_PULLUP + //#define FIL_RUNOUT6_PULLDOWN + //#define FIL_RUNOUT7_STATE LOW + //#define FIL_RUNOUT7_PULLUP + //#define FIL_RUNOUT7_PULLDOWN + //#define FIL_RUNOUT8_STATE LOW - #endif + //#define FIL_RUNOUT8_PULLUP + //#define FIL_RUNOUT8_PULLDOWN + #endif // DISTINCT_FIL_RUNOUT_STATES // Set one or more commands to execute on filament runout. // (After 'M412 H' Marlin will ask the host to handle the process.) diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index c811cf043e..445feaaac2 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -149,18 +149,106 @@ class FilamentSensorBase { public: static inline void setup() { - #if ENABLED(FIL_RUNOUT_PULLUP) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P) - #elif ENABLED(FIL_RUNOUT_PULLDOWN) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLDOWN(P) - #else - #define INIT_RUNOUT_PIN(P) SET_INPUT(P) - #endif + #if ENABLED(DISTINCT_FIL_RUNOUT_STATES) + #if ENABLED(FIL_RUNOUT1_PULLUP) + #define INIT_RUNOUT1_PIN(P) SET_INPUT_PULLUP(P) + #elif ENABLED(FIL_RUNOUT1_PULLDOWN) + #define INIT_RUNOUT1_PIN(P) SET_INPUT_PULLDOWN(P) + #else + #define INIT_RUNOUT1_PIN(P) SET_INPUT(P) + #endif + #if NUM_RUNOUT_SENSORS > 1 + #if ENABLED(FIL_RUNOUT2_PULLUP) + #define INIT_RUNOUT2_PIN(P) SET_INPUT_PULLUP(P) + #elif ENABLED(FIL_RUNOUT2_PULLDOWN) + #define INIT_RUNOUT2_PIN(P) SET_INPUT_PULLDOWN(P) + #else + #define INIT_RUNOUT2_PIN(P) SET_INPUT(P) + #endif + #endif + #if NUM_RUNOUT_SENSORS > 2 + #if ENABLED(FIL_RUNOUT3_PULLUP) + #define INIT_RUNOUT3_PIN(P) SET_INPUT_PULLUP(P) + #elif ENABLED(FIL_RUNOUT3_PULLDOWN) + #define INIT_RUNOUT3_PIN(P) SET_INPUT_PULLDOWN(P) + #else + #define INIT_RUNOUT3_PIN(P) SET_INPUT(P) + #endif + #endif + #if NUM_RUNOUT_SENSORS > 3 + #if ENABLED(FIL_RUNOUT4_PULLUP) + #define INIT_RUNOUT4_PIN(P) SET_INPUT_PULLUP(P) + #elif ENABLED(FIL_RUNOUT4_PULLDOWN) + #define INIT_RUNOUT4_PIN(P) SET_INPUT_PULLDOWN(P) + #else + #define INIT_RUNOUT4_PIN(P) SET_INPUT(P) + #endif + #endif + #if NUM_RUNOUT_SENSORS > 4 + #if ENABLED(FIL_RUNOUT5_PULLUP) + #define INIT_RUNOUT5_PIN(P) SET_INPUT_PULLUP(P) + #elif ENABLED(FIL_RUNOUT5_PULLDOWN) + #define INIT_RUNOUT5_PIN(P) SET_INPUT_PULLDOWN(P) + #else + #define INIT_RUNOUT5_PIN(P) SET_INPUT(P) + #endif + #endif + #if NUM_RUNOUT_SENSORS > 5 + #if ENABLED(FIL_RUNOUT6_PULLUP) + #define INIT_RUNOUT6_PIN(P) SET_INPUT_PULLUP(P) + #elif ENABLED(FIL_RUNOUT6_PULLDOWN) + #define INIT_RUNOUT6_PIN(P) SET_INPUT_PULLDOWN(P) + #else + #define INIT_RUNOUT6_PIN(P) SET_INPUT(P) + #endif + #endif + #if NUM_RUNOUT_SENSORS > 6 + #if ENABLED(FIL_RUNOUT7_PULLUP) + #define INIT_RUNOUT7_PIN(P) SET_INPUT_PULLUP(P) + #elif ENABLED(FIL_RUNOUT7_PULLDOWN) + #define INIT_RUNOUT7_PIN(P) SET_INPUT_PULLDOWN(P) + #else + #define INIT_RUNOUT7_PIN(P) SET_INPUT(P) + #endif + #endif + #if NUM_RUNOUT_SENSORS > 7 + #if ENABLED(FIL_RUNOUT8_PULLUP) + #define INIT_RUNOUT8_PIN(P) SET_INPUT_PULLUP(P) + #elif ENABLED(FIL_RUNOUT8_PULLDOWN) + #define INIT_RUNOUT8_PIN(P) SET_INPUT_PULLDOWN(P) + #else + #define INIT_RUNOUT8_PIN(P) SET_INPUT(P) + #endif + #endif + #else // !ENABLED(DISTINCT_FIL_RUNOUT_STATES) + #if ENABLED(FIL_RUNOUT_PULLUP) + #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P) + #elif ENABLED(FIL_RUNOUT_PULLDOWN) + #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLDOWN(P) + #else + #define INIT_RUNOUT_PIN(P) SET_INPUT(P) + #endif + #endif // ENABLED(DISTINCT_FIL_RUNOUT_STATES) - #define _INIT_RUNOUT(N) INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN); + #if ENABLED(DISTINCT_FIL_RUNOUT_STATES) + #define _INIT_RUNOUT(N) INIT_RUNOUT##N##_PIN(FIL_RUNOUT##N##_PIN); + #else + #define _INIT_RUNOUT(N) INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN); + #endif REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _INIT_RUNOUT) #undef _INIT_RUNOUT - #undef INIT_RUNOUT_PIN + #if ENABLED(DISTINCT_FIL_RUNOUT_STATES) + #undef INIT_RUNOUT1_PIN + #undef INIT_RUNOUT2_PIN + #undef INIT_RUNOUT3_PIN + #undef INIT_RUNOUT4_PIN + #undef INIT_RUNOUT5_PIN + #undef INIT_RUNOUT6_PIN + #undef INIT_RUNOUT7_PIN + #undef INIT_RUNOUT8_PIN + #else + #undef INIT_RUNOUT_PIN + #endif } // Return a bitmask of runout pin states diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 57eaa39df7..324a0484bc 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -714,36 +714,121 @@ #define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE #endif #endif + #if EITHER(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN) + #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 // !ENABLED(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 // ENABLED(FIL_RUNOUT_PULLUP) + #endif // EITHER(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN) #else // !ENABLED(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 // ENABLED(DISTINCT_FIL_RUNOUT_STATES) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 242ca21c25..071fe31f69 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -831,46 +831,85 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #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."); #endif - #if DISABLED(DISTINCT_FIL_RUNOUT_STATES) - #ifdef FIL_RUNOUT1_STATE - #warning "You have defined FIL_RUNOUT1_STATE but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #if ENABLED(DISTINCT_FIL_RUNOUT_STATES) + #if BOTH(FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN) + #error "Enable only one of FIL_RUNOUT1_PULLUP or FIL_RUNOUT1_PULLDOWN." #endif #if NUM_RUNOUT_SENSORS > 1 - #ifdef FIL_RUNOUT2_STATE - #warning "You have defined FIL_RUNOUT2_STATE but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #if BOTH(FIL_RUNOUT2_PULLUP, FIL_RUNOUT2_PULLDOWN) + #error "Enable only one of FIL_RUNOUT2_PULLUP or FIL_RUNOUT2_PULLDOWN." #endif #endif #if NUM_RUNOUT_SENSORS > 2 - #ifdef FIL_RUNOUT3_STATE - #warning "You have defined FIL_RUNOUT3_STATE but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #if BOTH(FIL_RUNOUT3_PULLUP, FIL_RUNOUT3_PULLDOWN) + #error "Enable only one of FIL_RUNOUT3_PULLUP or FIL_RUNOUT3_PULLDOWN." #endif #endif #if NUM_RUNOUT_SENSORS > 3 - #ifdef FIL_RUNOUT4_STATE - #warning "You have defined FIL_RUNOUT4_STATE but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #if BOTH(FIL_RUNOUT4_PULLUP, FIL_RUNOUT4_PULLDOWN) + #error "Enable only one of FIL_RUNOUT4_PULLUP or FIL_RUNOUT4_PULLDOWN." #endif #endif #if NUM_RUNOUT_SENSORS > 4 - #ifdef FIL_RUNOUT5_STATE - #warning "You have defined FIL_RUNOUT5_STATE but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #if BOTH(FIL_RUNOUT5_PULLUP, FIL_RUNOUT5_PULLDOWN) + #error "Enable only one of FIL_RUNOUT5_PULLUP or FIL_RUNOUT5_PULLDOWN." #endif #endif #if NUM_RUNOUT_SENSORS > 5 - #ifdef FIL_RUNOUT6_STATE - #warning "You have defined FIL_RUNOUT6_STATE but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #if BOTH(FIL_RUNOUT6_PULLUP, FIL_RUNOUT6_PULLDOWN) + #error "Enable only one of FIL_RUNOUT6_PULLUP or FIL_RUNOUT6_PULLDOWN." #endif #endif #if NUM_RUNOUT_SENSORS > 6 - #ifdef FIL_RUNOUT7_STATE - #warning "You have defined FIL_RUNOUT7_STATE but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #if BOTH(FIL_RUNOUT7_PULLUP, FIL_RUNOUT7_PULLDOWN) + #error "Enable only one of FIL_RUNOUT7_PULLUP or FIL_RUNOUT7_PULLDOWN." #endif #endif #if NUM_RUNOUT_SENSORS > 7 - #ifdef FIL_RUNOUT8_STATE - #warning "You have defined FIL_RUNOUT8_STATE but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #if BOTH(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN) + #error "Enable only one of FIL_RUNOUT8_PULLUP or FIL_RUNOUT8_PULLDOWN." #endif #endif - #endif // DISABLED(DISTINCT_FIL_RUNOUT_STATES) + #else // !ENABLED(DISTINCT_FIL_RUNOUT_STATES) + #if MANY(defined(FIL_RUNOUT1_STATE), FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN) + #warning "You have defined FIL_RUNOUT1_STATE/FIL_RUNOUT1_PULLUP/FIL_RUNOUT1_PULLDOWN but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #endif + #if NUM_RUNOUT_SENSORS > 1 + #if MANY(defined(FIL_RUNOUT2_STATE), FIL_RUNOUT2_PULLUP, FIL_RUNOUT2_PULLDOWN) + #warning "You have defined FIL_RUNOUT2_STATE/FIL_RUNOUT2_PULLUP/FIL_RUNOUT2_PULLDOWN but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #endif + #endif + #if NUM_RUNOUT_SENSORS > 2 + #if MANY(defined(FIL_RUNOUT3_STATE), FIL_RUNOUT3_PULLUP, FIL_RUNOUT3_PULLDOWN) + #warning "You have defined FIL_RUNOUT3_STATE/FIL_RUNOUT3_PULLUP/FIL_RUNOUT3_PULLDOWN but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #endif + #endif + #if NUM_RUNOUT_SENSORS > 3 + #if MANY(defined(FIL_RUNOUT4_STATE), FIL_RUNOUT4_PULLUP, FIL_RUNOUT4_PULLDOWN) + #warning "You have defined FIL_RUNOUT4_STATE/FIL_RUNOUT4_PULLUP/FIL_RUNOUT4_PULLDOWN but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #endif + #endif + #if NUM_RUNOUT_SENSORS > 4 + #if MANY(defined(FIL_RUNOUT5_STATE), FIL_RUNOUT5_PULLUP, FIL_RUNOUT5_PULLDOWN) + #warning "You have defined FIL_RUNOUT5_STATE/FIL_RUNOUT5_PULLUP/FIL_RUNOUT5_PULLDOWN but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #endif + #endif + #if NUM_RUNOUT_SENSORS > 5 + #if MANY(defined(FIL_RUNOUT6_STATE), FIL_RUNOUT6_PULLUP, FIL_RUNOUT6_PULLDOWN) + #warning "You have defined FIL_RUNOUT6_STATE/FIL_RUNOUT6_PULLUP/FIL_RUNOUT6_PULLDOWN but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #endif + #endif + #if NUM_RUNOUT_SENSORS > 6 + #if MANY(defined(FIL_RUNOUT7_STATE), FIL_RUNOUT7_PULLUP, FIL_RUNOUT7_PULLDOWN) + #warning "You have defined FIL_RUNOUT7_STATE/FIL_RUNOUT7_PULLUP/FIL_RUNOUT7_PULLDOWN but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #endif + #endif + #if NUM_RUNOUT_SENSORS > 7 + #if MANY(defined(FIL_RUNOUT8_STATE), FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN) + #warning "You have defined FIL_RUNOUT8_STATE/FIL_RUNOUT8_PULLUP/FIL_RUNOUT8_PULLDOWN but you haven't defined DISTINCT_FIL_RUNOUT_STATES" + #endif + #endif + #endif // ENABLED(DISTINCT_FIL_RUNOUT_STATES) #endif /**