From 013a09dbe632fad0b6342a43fdc1dec59e53b2c2 Mon Sep 17 00:00:00 2001 From: paclema Date: Wed, 29 Apr 2015 21:38:40 +0200 Subject: [PATCH 1/3] Added configurable script for filrunout form configuration.h --- Marlin/Configuration.h | 7 +++++-- Marlin/Marlin_main.cpp | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 455e46a195..ce5933319b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -417,8 +417,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 //=========================================================================== //============================ Mesh Bed Leveling ============================ diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 996bd60b91..4f12d6498c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6140,10 +6140,10 @@ void kill() void filrunout() { if (!filrunoutEnqueued) { filrunoutEnqueued = true; - enqueuecommand("M600"); + enqueuecommands_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); + st_synchronize(); } } - #endif void Stop() { From aedd58091162ced31f6b1336268b4e4f4b01f531 Mon Sep 17 00:00:00 2001 From: paclema Date: Sun, 3 May 2015 02:28:43 +0200 Subject: [PATCH 2/3] Updated all configuration.h examples --- Marlin/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 9 ++++++--- Marlin/example_configurations/Felix/Configuration_DUAL.h | 9 ++++++--- Marlin/example_configurations/Hephestos/Configuration.h | 9 ++++++--- Marlin/example_configurations/K8200/Configuration.h | 7 +++++-- Marlin/example_configurations/SCARA/Configuration.h | 9 ++++++--- Marlin/example_configurations/WITBOX/Configuration.h | 9 ++++++--- .../example_configurations/delta/generic/Configuration.h | 9 ++++++--- .../delta/kossel_mini/Configuration.h | 9 ++++++--- Marlin/example_configurations/makibox/Configuration.h | 8 +++++--- .../example_configurations/tvrrug/Round2/Configuration.h | 7 +++++-- 11 files changed, 58 insertions(+), 29 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ce5933319b..535d1319d0 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1,4 +1,4 @@ -#ifndef CONFIGURATION_H +f#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 63b3660d54..7ef5228fe4 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -356,9 +356,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 085d95b271..425608da58 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -356,9 +356,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 c9c079ebe6..a25e8f3f2a 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -377,9 +377,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 d0abbcbe71..2cd07ec73d 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -433,8 +433,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 //=========================================================================== //============================ Mesh Bed Leveling ============================ diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index cdc036cb2e..d88aea6c96 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -408,9 +408,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 343c3093ac..1925522bc0 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -376,9 +376,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 9a1fe48756..4324bb4bf7 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -406,9 +406,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 33391863eb..fb2f3aca22 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -406,9 +406,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 918d5fa8bd..6e8286f3af 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -376,9 +376,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 2fff0f21e3..43be3262c6 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -378,8 +378,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 ========================== From 26015b02d8b153b4d583f3838ffdd65cd1258831 Mon Sep 17 00:00:00 2001 From: paclema Date: Sun, 3 May 2015 02:39:34 +0200 Subject: [PATCH 3/3] Fixed typo and updated Configuration.h of configurator --- Marlin/Configuration.h | 2 +- Marlin/configurator/config/Configuration.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 535d1319d0..ce5933319b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1,4 +1,4 @@ -f#ifndef CONFIGURATION_H +#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "boards.h" diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 1d85de9266..24c6021038 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -417,8 +417,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 ==========================