From c28749a5677f941ca45945bc1bd9cafc45802368 Mon Sep 17 00:00:00 2001 From: Ben Lye Date: Sun, 2 Jul 2017 09:44:24 +0100 Subject: [PATCH] Add kill action Sends pre-defined string as action command when printer is kill. --- Marlin/Configuration_adv.h | 7 +++++++ Marlin/Marlin_main.cpp | 4 ++++ Marlin/example_configurations/Anet/A6/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/Anet/A8/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/Cartesio/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/Felix/Configuration_adv.h | 7 +++++++ .../FolgerTech-i3-2020/Configuration_adv.h | 7 +++++++ .../example_configurations/Hephestos/Configuration_adv.h | 7 +++++++ .../example_configurations/Hephestos_2/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/K8200/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/K8400/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/M150/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/RigidBot/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/SCARA/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/TAZ4/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/TinyBoy2/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/WITBOX/Configuration_adv.h | 7 +++++++ .../delta/FLSUN/auto_calibrate/Configuration_adv.h | 7 +++++++ .../delta/FLSUN/kossel_mini/Configuration_adv.h | 7 +++++++ .../delta/generic/Configuration_adv.h | 7 +++++++ .../delta/kossel_mini/Configuration_adv.h | 7 +++++++ .../delta/kossel_pro/Configuration_adv.h | 7 +++++++ .../delta/kossel_xl/Configuration_adv.h | 7 +++++++ .../gCreate_gMax1.5+/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/makibox/Configuration_adv.h | 7 +++++++ .../tvrrug/Round2/Configuration_adv.h | 7 +++++++ Marlin/example_configurations/wt150/Configuration_adv.h | 7 +++++++ 27 files changed, 186 insertions(+) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index e68c48563..57c371613 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1268,6 +1268,13 @@ #define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c280c1002..0b2765acb 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -12836,6 +12836,10 @@ void kill(const char* lcd_msg) { _delay_ms(250); //Wait to ensure all interrupts routines stopped thermalManager.disable_all_heaters(); //turn off heaters again + #if defined(ACTION_ON_KILL) + SERIAL_ECHOLNPGM("//action:" ACTION_ON_KILL); + #endif + #if HAS_POWER_SWITCH SET_INPUT(PS_ON_PIN); #endif diff --git a/Marlin/example_configurations/Anet/A6/Configuration_adv.h b/Marlin/example_configurations/Anet/A6/Configuration_adv.h index 30526adf6..ea27f9331 100644 --- a/Marlin/example_configurations/Anet/A6/Configuration_adv.h +++ b/Marlin/example_configurations/Anet/A6/Configuration_adv.h @@ -1268,6 +1268,13 @@ #define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/Anet/A8/Configuration_adv.h b/Marlin/example_configurations/Anet/A8/Configuration_adv.h index cc72206cf..c264b17be 100644 --- a/Marlin/example_configurations/Anet/A8/Configuration_adv.h +++ b/Marlin/example_configurations/Anet/A8/Configuration_adv.h @@ -1268,6 +1268,13 @@ #define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 1de847b7f..f71292cbd 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -1261,6 +1261,13 @@ #define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 8e5e5fab0..94fcbf30b 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -1261,6 +1261,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h b/Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h index 5031cfb2d..4b3fb3568 100644 --- a/Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h +++ b/Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h @@ -1274,6 +1274,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index bf39fff88..89f30b1fe 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -1261,6 +1261,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 4be6605e3..8ee2095aa 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -1244,6 +1244,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index d931ab26c..5adbc19d8 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -1274,6 +1274,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 0f650aa95..04ed926e1 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -1261,6 +1261,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/M150/Configuration_adv.h b/Marlin/example_configurations/M150/Configuration_adv.h index 49bcfcf58..d31f0320a 100644 --- a/Marlin/example_configurations/M150/Configuration_adv.h +++ b/Marlin/example_configurations/M150/Configuration_adv.h @@ -1268,6 +1268,13 @@ #define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 84921f225..ac15cd356 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -1261,6 +1261,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 59304ae0c..d820ed78b 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -1261,6 +1261,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index f7184724f..6800a96bc 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -1261,6 +1261,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h index 494d58ca0..5f332f31a 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h @@ -1264,6 +1264,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index bf39fff88..89f30b1fe 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -1261,6 +1261,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h index 51019d228..66b681d17 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -1266,6 +1266,13 @@ #define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h index d00185a6a..8de3b0bdf 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -1265,6 +1265,13 @@ #define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 6fd092e0b..fd2bdf30f 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -1263,6 +1263,13 @@ #define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 6fd092e0b..fd2bdf30f 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -1263,6 +1263,13 @@ #define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index f2a74f291..f7ae11b99 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -1268,6 +1268,13 @@ #define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 00a02b39b..ef02e7559 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -1263,6 +1263,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h b/Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h index cf0cc38ef..784624954 100644 --- a/Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h +++ b/Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h @@ -1270,6 +1270,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 8a7a61da4..58b2a842d 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -1261,6 +1261,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 5de0a43bb..de5a967b7 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -1261,6 +1261,13 @@ //#define USER_GCODE_5 "G28\nM503" #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //=========================================================================== diff --git a/Marlin/example_configurations/wt150/Configuration_adv.h b/Marlin/example_configurations/wt150/Configuration_adv.h index 97f73b2e8..bf612de94 100644 --- a/Marlin/example_configurations/wt150/Configuration_adv.h +++ b/Marlin/example_configurations/wt150/Configuration_adv.h @@ -1351,6 +1351,13 @@ #endif +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + //=========================================================================== //====================== I2C Position Encoder Settings ====================== //===========================================================================