diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 69bf148bb3..6f2333de8f 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -411,8 +411,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif //=========================================================================== //=========================== Manual Bed Leveling =========================== diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a8bedb8411..8b719bd499 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6213,10 +6213,10 @@ void kill() void filrunout() { if (!filrunoutEnqueued) { filrunoutEnqueued = true; - enqueuecommand("M600"); + enqueuecommands_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); + st_synchronize(); } } - #endif void Stop() { diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index d888911b65..35820a4eb2 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -410,8 +410,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif //=========================================================================== //=========================== Manual Bed Leveling =========================== diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index af0cfba32b..294407367f 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -349,9 +349,12 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. - +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + //=========================================================================== //=========================== Manual Bed Leveling =========================== //=========================================================================== diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index cc335fb710..6c5c50f227 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -349,9 +349,12 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. - +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + //=========================================================================== //=========================== Manual Bed Leveling =========================== //=========================================================================== diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 0fab231ecf..595a63a5bd 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -370,9 +370,12 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. - +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + //=========================================================================== //=========================== Manual Bed Leveling =========================== //=========================================================================== diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index e604024501..f39775c6bc 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -426,8 +426,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif //=========================================================================== //=========================== Manual Bed Leveling =========================== diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index ed074a0e2c..151b703002 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -401,9 +401,12 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. - +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + //=========================================================================== //=========================== Manual Bed Leveling =========================== //=========================================================================== diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index d585533b94..218396d136 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -369,9 +369,12 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. - +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + //=========================================================================== //=========================== Manual Bed Leveling =========================== //=========================================================================== diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index ef8037ca76..270a3b5dc4 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -399,9 +399,12 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. - +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + //=========================================================================== //=========================== Manual Bed Leveling =========================== //=========================================================================== diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 863087c1b4..85290fb9f4 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -399,9 +399,12 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. - +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + //=========================================================================== //=========================== Manual Bed Leveling =========================== //=========================================================================== diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index a39f4786fe..432cd449fb 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -369,9 +369,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. - +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif //=========================================================================== //=========================== Manual Bed Leveling =========================== //=========================================================================== diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 506bade82b..e0f054b5b3 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -371,8 +371,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned -//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. +#ifdef FILAMENT_RUNOUT_SENSOR + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif //=========================================================================== //=========================== Manual Bed Leveling ===========================