forked from Mirrors/Marlin
🚸 Extra parsing of safety commands (#26944)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
333608a692
commit
bfe9885603
@@ -86,6 +86,8 @@ public:
|
|||||||
|
|
||||||
static void update(State &state, const uint8_t c);
|
static void update(State &state, const uint8_t c);
|
||||||
|
|
||||||
|
static bool isEnabled() { return enabled; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool enabled;
|
static bool enabled;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -298,10 +298,10 @@ bool load_filament(const float slow_load_length/*=0*/, const float fast_load_len
|
|||||||
// Show "Purge More" / "Resume" menu and wait for reply
|
// Show "Purge More" / "Resume" menu and wait for reply
|
||||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
marlin.user_resume();
|
marlin.user_resume();
|
||||||
|
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
|
||||||
#if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI)
|
#if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI)
|
||||||
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // MarlinUI and MKS UI also set PAUSE_RESPONSE_WAIT_FOR
|
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // MarlinUI and MKS UI also set PAUSE_RESPONSE_WAIT_FOR
|
||||||
#else
|
#else
|
||||||
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
|
|
||||||
TERN_(SOVOL_SV06_RTS, rts.gotoPage(ID_PurgeMore_L, ID_PurgeMore_D));
|
TERN_(SOVOL_SV06_RTS, rts.gotoPage(ID_PurgeMore_L, ID_PurgeMore_D));
|
||||||
#endif
|
#endif
|
||||||
while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) marlin.idle_no_sleep();
|
while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) marlin.idle_no_sleep();
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if DISABLED(EMERGENCY_PARSER)
|
|
||||||
|
|
||||||
#include "../gcode.h"
|
#include "../gcode.h"
|
||||||
#include "../../module/motion.h" // for quickstop_stepper
|
#include "../../module/motion.h" // for quickstop_stepper
|
||||||
|
|
||||||
@@ -50,5 +47,3 @@ void GcodeSuite::M112() {
|
|||||||
void GcodeSuite::M410() {
|
void GcodeSuite::M410() {
|
||||||
quickstop_stepper();
|
quickstop_stepper();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !EMERGENCY_PARSER
|
|
||||||
|
|||||||
@@ -597,17 +597,11 @@ void GcodeSuite::process_parsed_command(bool no_ok/*=false*/) {
|
|||||||
case 110: M110(); break; // M110: Set Current Line Number
|
case 110: M110(); break; // M110: Set Current Line Number
|
||||||
case 111: M111(); break; // M111: Set debug level
|
case 111: M111(); break; // M111: Set debug level
|
||||||
|
|
||||||
#if DISABLED(EMERGENCY_PARSER)
|
case 108: M108(); break; // M108: Cancel Waiting
|
||||||
case 108: M108(); break; // M108: Cancel Waiting
|
case 112: M112(); break; // M112: Full Shutdown
|
||||||
case 112: M112(); break; // M112: Full Shutdown
|
case 410: M410(); break; // M410: Quickstop - Abort all the planned moves.
|
||||||
case 410: M410(); break; // M410: Quickstop - Abort all the planned moves.
|
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
case 876: M876(); break; // M876: Handle Host prompt responses
|
||||||
case 876: M876(); break; // M876: Handle Host prompt responses
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
case 108: case 112: case 410:
|
|
||||||
TERN_(HOST_PROMPT_SUPPORT, case 876:)
|
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(HOST_KEEPALIVE_FEATURE)
|
#if ENABLED(HOST_KEEPALIVE_FEATURE)
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
* M105 - Report current temperatures.
|
* M105 - Report current temperatures.
|
||||||
* M106 - Set print fan speed.
|
* M106 - Set print fan speed.
|
||||||
* M107 - Print fan off.
|
* M107 - Print fan off.
|
||||||
* M108 - Break out of heating loops (M109, M190, M303). With no controller, breaks out of M0/M1. (Requires EMERGENCY_PARSER)
|
* M108 - Break out of heating loops (M109, M190, M303). With no controller, breaks out of M0/M1.
|
||||||
* M109 - S<temp> Wait for extruder current temp to reach target temp. ** Wait only when heating! **
|
* M109 - S<temp> Wait for extruder current temp to reach target temp. ** Wait only when heating! **
|
||||||
* R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
|
* R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
|
||||||
* If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
|
* If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
|
||||||
@@ -310,7 +310,7 @@
|
|||||||
* M869 - Report position encoder module error.
|
* M869 - Report position encoder module error.
|
||||||
*
|
*
|
||||||
* M871 - Print/Reset/Clear first layer temperature offset values. (Requires PTC_PROBE, PTC_BED, or PTC_HOTEND)
|
* M871 - Print/Reset/Clear first layer temperature offset values. (Requires PTC_PROBE, PTC_BED, or PTC_HOTEND)
|
||||||
* M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT and not EMERGENCY_PARSER)
|
* M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT)
|
||||||
* M900 - Set / Report Linear Advance K-factor (Requires LIN_ADVANCE or FT_MOTION) and Smoothing Tau factor (Requires SMOOTH_LIN_ADVANCE).
|
* M900 - Set / Report Linear Advance K-factor (Requires LIN_ADVANCE or FT_MOTION) and Smoothing Tau factor (Requires SMOOTH_LIN_ADVANCE).
|
||||||
* M906 - Set / Report motor current in milliamps using axis codes XYZE, etc. Report values if no axis codes given. (Requires *_DRIVER_TYPE TMC(2130|2160|5130|5160|2208|2209|2240|2660))
|
* M906 - Set / Report motor current in milliamps using axis codes XYZE, etc. Report values if no axis codes given. (Requires *_DRIVER_TYPE TMC(2130|2160|5130|5160|2208|2209|2240|2660))
|
||||||
* M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots)
|
* M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots)
|
||||||
@@ -354,6 +354,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../inc/MarlinConfig.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
#include "../module/temperature.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
|
|
||||||
#if ENABLED(I2C_POSITION_ENCODERS)
|
#if ENABLED(I2C_POSITION_ENCODERS)
|
||||||
@@ -382,6 +383,9 @@ typedef bits_t(NUM_REL_MODES) relative_t;
|
|||||||
extern const char G28_STR[];
|
extern const char G28_STR[];
|
||||||
|
|
||||||
class GcodeSuite {
|
class GcodeSuite {
|
||||||
|
|
||||||
|
friend void Temperature::task();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static relative_t axis_relative;
|
static relative_t axis_relative;
|
||||||
@@ -785,13 +789,11 @@ private:
|
|||||||
static void M107();
|
static void M107();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DISABLED(EMERGENCY_PARSER)
|
static void M108();
|
||||||
static void M108();
|
static void M112();
|
||||||
static void M112();
|
static void M410();
|
||||||
static void M410();
|
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
static void M876();
|
||||||
static void M876();
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void M110();
|
static void M110();
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
|
|
||||||
#if HAS_GCODE_M876
|
#if HAS_GCODE_M876
|
||||||
|
|
||||||
|
#if ENABLED(EMERGENCY_PARSER)
|
||||||
|
#include "../../feature/e_parser.h"
|
||||||
|
#endif
|
||||||
#include "../../feature/host_actions.h"
|
#include "../../feature/host_actions.h"
|
||||||
#include "../gcode.h"
|
#include "../gcode.h"
|
||||||
|
|
||||||
|
|||||||
@@ -535,14 +535,12 @@ void GCodeQueue::get_serial_commands() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DISABLED(EMERGENCY_PARSER)
|
// Process critical commands early
|
||||||
// Process critical commands early
|
if (command[0] == 'M') switch (command[3]) {
|
||||||
if (command[0] == 'M') switch (command[3]) {
|
case '8': if (command[2] == '0' && command[1] == '1') { marlin.end_waiting(); } break;
|
||||||
case '8': if (command[2] == '0' && command[1] == '1') { marlin.end_waiting(); } break;
|
case '2': if (command[2] == '1' && command[1] == '1') marlin.kill(FPSTR(M112_KILL_STR), nullptr, true); break;
|
||||||
case '2': if (command[2] == '1' && command[1] == '1') marlin.kill(FPSTR(M112_KILL_STR), nullptr, true); break;
|
case '0': if (command[1] == '4' && command[2] == '1') quickstop_stepper(); break;
|
||||||
case '0': if (command[1] == '4' && command[2] == '1') quickstop_stepper(); break;
|
}
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if NO_TIMEOUTS > 0
|
#if NO_TIMEOUTS > 0
|
||||||
last_command_time = ms;
|
last_command_time = ms;
|
||||||
|
|||||||
@@ -1136,7 +1136,7 @@
|
|||||||
#undef SERIAL_XON_XOFF
|
#undef SERIAL_XON_XOFF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
|
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||||
#define HAS_GCODE_M876 1
|
#define HAS_GCODE_M876 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -2317,19 +2317,18 @@ void Temperature::task() {
|
|||||||
REMEMBER(mh, no_reentry, true);
|
REMEMBER(mh, no_reentry, true);
|
||||||
|
|
||||||
#if ENABLED(EMERGENCY_PARSER)
|
#if ENABLED(EMERGENCY_PARSER)
|
||||||
if (emergency_parser.killed_by_M112)
|
if (emergency_parser.killed_by_M112) gcode.M112();
|
||||||
marlin.kill(FPSTR(M112_KILL_STR), nullptr, true);
|
|
||||||
|
|
||||||
if (emergency_parser.quickstop_by_M410) {
|
if (emergency_parser.quickstop_by_M410) {
|
||||||
emergency_parser.quickstop_by_M410 = false; // quickstop_stepper may call idle so clear this now!
|
emergency_parser.quickstop_by_M410 = false; // quickstop_stepper may call idle so clear this now!
|
||||||
quickstop_stepper();
|
gcode.M410();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAS_MEDIA
|
#if HAS_MEDIA
|
||||||
if (emergency_parser.sd_abort_by_M524) { // abort SD print immediately
|
if (emergency_parser.sd_abort_by_M524) { // abort SD print immediately
|
||||||
emergency_parser.sd_abort_by_M524 = false;
|
emergency_parser.sd_abort_by_M524 = false;
|
||||||
card.flag.abort_sd_printing = true;
|
card.flag.abort_sd_printing = true;
|
||||||
gcode.process_subcommands_now(F("M524"));
|
gcode.M524();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1103,7 +1103,9 @@ void CardReader::closefile(const bool store_location/*=false*/) {
|
|||||||
flag.saving = flag.logging = false;
|
flag.saving = flag.logging = false;
|
||||||
sdpos = 0;
|
sdpos = 0;
|
||||||
|
|
||||||
TERN_(EMERGENCY_PARSER, emergency_parser.enable());
|
#if DISABLED(SDCARD_READONLY)
|
||||||
|
TERN_(EMERGENCY_PARSER, emergency_parser.enable());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (store_location) {
|
if (store_location) {
|
||||||
// TODO: Store printer state, filename, position
|
// TODO: Store printer state, filename, position
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ USE_CONTROLLER_FAN = build_src_filter=+<src/feature/controll
|
|||||||
HAS_COOLER|LASER_COOLANT_FLOW_METER = build_src_filter=+<src/feature/cooler.cpp>
|
HAS_COOLER|LASER_COOLANT_FLOW_METER = build_src_filter=+<src/feature/cooler.cpp>
|
||||||
HAS_MOTOR_CURRENT_DAC = build_src_filter=+<src/feature/dac>
|
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>
|
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>
|
EASYTHREED_UI = build_src_filter=+<src/feature/easythreed_ui.cpp>
|
||||||
I2C_POSITION_ENCODERS = build_src_filter=+<src/feature/encoder_i2c.cpp>
|
I2C_POSITION_ENCODERS = build_src_filter=+<src/feature/encoder_i2c.cpp>
|
||||||
IIC_BL24CXX_EEPROM = build_src_filter=+<src/libs/BL24CXX.cpp>
|
IIC_BL24CXX_EEPROM = build_src_filter=+<src/libs/BL24CXX.cpp>
|
||||||
|
|||||||
Reference in New Issue
Block a user