Always parse safety commands at all levels
This commit is contained in:
@@ -79,7 +79,6 @@ public:
|
||||
|
||||
static void update(State &state, const uint8_t c);
|
||||
|
||||
private:
|
||||
static bool enabled;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if DISABLED(EMERGENCY_PARSER)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../MarlinCore.h" // for wait_for_heatup, kill, M112_KILL_STR
|
||||
#include "../../module/motion.h" // for quickstop_stepper
|
||||
@@ -53,4 +50,3 @@ void GcodeSuite::M410() {
|
||||
quickstop_stepper();
|
||||
}
|
||||
|
||||
#endif // !EMERGENCY_PARSER
|
||||
|
||||
@@ -585,17 +585,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 110: M110(); break; // M110: Set Current Line Number
|
||||
case 111: M111(); break; // M111: Set debug level
|
||||
|
||||
#if DISABLED(EMERGENCY_PARSER)
|
||||
case 108: M108(); break; // M108: Cancel Waiting
|
||||
case 112: M112(); break; // M112: Full Shutdown
|
||||
case 410: M410(); break; // M410: Quickstop - Abort all the planned moves.
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
case 876: M876(); break; // M876: Handle Host prompt responses
|
||||
#endif
|
||||
#else
|
||||
case 108: case 112: case 410:
|
||||
TERN_(HOST_PROMPT_SUPPORT, case 876:)
|
||||
break;
|
||||
case 108: M108(); break; // M108: Cancel Waiting
|
||||
case 112: M112(); break; // M112: Full Shutdown
|
||||
case 410: M410(); break; // M410: Quickstop - Abort all the planned moves.
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
case 876: M876(); break; // M876: Handle Host prompt responses
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_KEEPALIVE_FEATURE)
|
||||
|
||||
@@ -751,13 +751,11 @@ private:
|
||||
static void M107();
|
||||
#endif
|
||||
|
||||
#if DISABLED(EMERGENCY_PARSER)
|
||||
static void M108();
|
||||
static void M112();
|
||||
static void M410();
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
static void M876();
|
||||
#endif
|
||||
static void M108();
|
||||
static void M112();
|
||||
static void M410();
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
static void M876();
|
||||
#endif
|
||||
|
||||
static void M110();
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
|
||||
#if HAS_GCODE_M876
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
#include "../../feature/e_parser.h"
|
||||
#endif
|
||||
#include "../../feature/host_actions.h"
|
||||
#include "../gcode.h"
|
||||
#include "../../MarlinCore.h"
|
||||
@@ -32,8 +35,8 @@
|
||||
* M876: Handle Prompt Response
|
||||
*/
|
||||
void GcodeSuite::M876() {
|
||||
|
||||
if (parser.seenval('S')) hostui.handle_response((uint8_t)parser.value_int());
|
||||
if(TERN1(EMERGENCY_PARSER, emergency_parser.enabled))
|
||||
if (parser.seenval('S')) hostui.handle_response((uint8_t)parser.value_int());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -535,14 +535,12 @@ void GCodeQueue::get_serial_commands() {
|
||||
}
|
||||
}
|
||||
|
||||
#if DISABLED(EMERGENCY_PARSER)
|
||||
// Process critical commands early
|
||||
if (command[0] == 'M') switch (command[3]) {
|
||||
case '8': if (command[2] == '0' && command[1] == '1') { wait_for_heatup = false; TERN_(HAS_MARLINUI_MENU, wait_for_user = false); } break;
|
||||
case '2': if (command[2] == '1' && command[1] == '1') kill(FPSTR(M112_KILL_STR), nullptr, true); break;
|
||||
case '0': if (command[1] == '4' && command[2] == '1') quickstop_stepper(); break;
|
||||
}
|
||||
#endif
|
||||
// Process critical commands early
|
||||
if (command[0] == 'M') switch (command[3]) {
|
||||
case '8': if (command[2] == '0' && command[1] == '1') { wait_for_heatup = false; TERN_(HAS_MARLINUI_MENU, wait_for_user = false); } break;
|
||||
case '2': if (command[2] == '1' && command[1] == '1') kill(FPSTR(M112_KILL_STR), nullptr, true); break;
|
||||
case '0': if (command[1] == '4' && command[2] == '1') quickstop_stepper(); break;
|
||||
}
|
||||
|
||||
#if NO_TIMEOUTS > 0
|
||||
last_command_time = ms;
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ USE_CONTROLLER_FAN = build_src_filter=+<src/feature/controll
|
||||
HAS_COOLER|LASER_COOLANT_FLOW_METER = build_src_filter=+<src/feature/cooler.cpp>
|
||||
HAS_MOTOR_CURRENT_DAC = build_src_filter=+<src/feature/dac>
|
||||
DIRECT_STEPPING = build_src_filter=+<src/feature/direct_stepping.cpp> +<src/gcode/motion/G6.cpp>
|
||||
EMERGENCY_PARSER = build_src_filter=+<src/feature/e_parser.cpp> -<src/gcode/control/M108_*.cpp>
|
||||
EMERGENCY_PARSER = build_src_filter=+<src/feature/e_parser.cpp>
|
||||
EASYTHREED_UI = build_src_filter=+<src/feature/easythreed_ui.cpp>
|
||||
I2C_POSITION_ENCODERS = build_src_filter=+<src/feature/encoder_i2c.cpp>
|
||||
IIC_BL24CXX_EEPROM = build_src_filter=+<src/libs/BL24CXX.cpp>
|
||||
|
||||
Reference in New Issue
Block a user