FULL_REPORT_TO_HOST_FEATURE
This commit is contained in:
parent
6759aff220
commit
56747e9ba1
18 changed files with 225 additions and 66 deletions
|
|
@ -1495,7 +1495,9 @@
|
|||
//
|
||||
#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages
|
||||
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
|
||||
#define KEEPALIVE_INTERVAL_DIVIDER 3 // Divide the KEEPALIVE_INTERVAL for faster reporting
|
||||
#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating
|
||||
#define FULL_REPORT_TO_HOST_FEATURE // Enable this to send Machine status reports while moving and status reports GRBL style
|
||||
|
||||
//
|
||||
// G20/G21 Inch mode support
|
||||
|
|
|
|||
|
|
@ -236,6 +236,8 @@ PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMST
|
|||
|
||||
MarlinState marlin_state = MF_INITIALIZING;
|
||||
|
||||
M_StateEnum M_State_grbl = M_INIT;
|
||||
|
||||
// For M109 and M190, this flag may be cleared (by M108) to exit the wait loop
|
||||
bool wait_for_heatup = true;
|
||||
|
||||
|
|
@ -341,6 +343,16 @@ void quickstop_stepper() {
|
|||
sync_plan_position();
|
||||
}
|
||||
|
||||
void quickpause_stepper() {
|
||||
planner.quick_pause();
|
||||
//planner.synchronize();
|
||||
}
|
||||
|
||||
void quickresume_stepper() {
|
||||
planner.quick_resume();
|
||||
//planner.synchronize();
|
||||
}
|
||||
|
||||
void enable_e_steppers() {
|
||||
#define _ENA_E(N) ENABLE_AXIS_E##N();
|
||||
REPEAT(E_STEPPERS, _ENA_E)
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, cons
|
|||
void minkill(const bool steppers_off=false);
|
||||
|
||||
void quickstop_stepper();
|
||||
void quickpause_stepper();
|
||||
void quickresume_stepper();
|
||||
|
||||
// Global State of the firmware
|
||||
enum MarlinState : uint8_t {
|
||||
|
|
@ -76,6 +78,27 @@ extern MarlinState marlin_state;
|
|||
inline bool IsRunning() { return marlin_state == MF_RUNNING; }
|
||||
inline bool IsStopped() { return marlin_state != MF_RUNNING; }
|
||||
|
||||
//
|
||||
// Enumerated Status indices
|
||||
// Coding as GRBL or TinyG for Machine states
|
||||
//
|
||||
enum M_StateEnum : uint8_t {
|
||||
M_INIT = 0, // 0 machine is initializing
|
||||
M_RESET, // 1 machine is ready for use
|
||||
M_ALARM, // 2 machine is in alarm state (soft shut down)
|
||||
M_IDLE, // 3 program stop or no more blocks (M0, M1, M60)
|
||||
M_END, // 4 program end via M2, M30
|
||||
M_RUNNING, // 5 motion is running
|
||||
M_HOLD, // 6 motion is holding
|
||||
M_PROBE, // 7 probe cycle active
|
||||
M_CYCLING, // 8 machine is running (cycling)
|
||||
M_HOMING, // 9 machine is homing
|
||||
M_JOGGING, // 10 machine is jogging
|
||||
M_ERROR // 11 machine is in hard alarm state (shut down)
|
||||
};
|
||||
|
||||
extern M_StateEnum M_State_grbl;
|
||||
|
||||
bool printingIsActive();
|
||||
bool printingIsPaused();
|
||||
void startOrResumeJob();
|
||||
|
|
|
|||
|
|
@ -34,30 +34,29 @@
|
|||
// External references
|
||||
extern bool wait_for_user, wait_for_heatup;
|
||||
void quickstop_stepper();
|
||||
void quickpause_stepper();
|
||||
void quickresume_stepper();
|
||||
void report_current_position_moving();
|
||||
|
||||
class EmergencyParser {
|
||||
|
||||
public:
|
||||
|
||||
// Currently looking for: M108, M112, M410, M876
|
||||
// S000 STATE , P000 for Pause, R000 for resume
|
||||
enum State : char {
|
||||
EP_RESET,
|
||||
EP_N,
|
||||
EP_M,
|
||||
EP_M1,
|
||||
EP_M10,
|
||||
EP_M108,
|
||||
EP_M11,
|
||||
EP_M112,
|
||||
EP_M4,
|
||||
EP_M41,
|
||||
EP_M410,
|
||||
EP_M10, EP_M108,
|
||||
EP_M11, EP_M112,
|
||||
EP_M4, EP_M41, EP_M410,
|
||||
EP_S, EP_S0, EP_S00, EP_grblSTATUS,
|
||||
EP_R, EP_R0, EP_R00, EP_grblRESUME,
|
||||
EP_P, EP_P0, EP_P00, EP_grblPAUSE,
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
EP_M8,
|
||||
EP_M87,
|
||||
EP_M876,
|
||||
EP_M876S,
|
||||
EP_M876SN,
|
||||
EP_M8, EP_M87, EP_M876, EP_M876S, EP_M876SN,
|
||||
#endif
|
||||
EP_IGNORE // to '\n'
|
||||
};
|
||||
|
|
@ -71,7 +70,6 @@ public:
|
|||
EmergencyParser() { enable(); }
|
||||
|
||||
FORCE_INLINE static void enable() { enabled = true; }
|
||||
|
||||
FORCE_INLINE static void disable() { enabled = false; }
|
||||
|
||||
FORCE_INLINE static void update(State &state, const uint8_t c) {
|
||||
|
|
@ -80,23 +78,35 @@ public:
|
|||
case EP_RESET:
|
||||
switch (c) {
|
||||
case ' ': case '\n': case '\r': break;
|
||||
case 'N': state = EP_N; break;
|
||||
case 'M': state = EP_M; break;
|
||||
default: state = EP_IGNORE;
|
||||
case 'N': state = EP_N; break;
|
||||
case 'M': state = EP_M; break;
|
||||
case 'S': state = EP_S; break;
|
||||
case 'P': state = EP_P; break;
|
||||
case 'R': state = EP_R; break;
|
||||
default: state = EP_IGNORE;
|
||||
}
|
||||
break;
|
||||
|
||||
case EP_N:
|
||||
switch (c) {
|
||||
case '0': case '1': case '2':
|
||||
case '3': case '4': case '5':
|
||||
case '6': case '7': case '8':
|
||||
case '9': case '-': case ' ': break;
|
||||
case '0' ... '9': case '-': case ' ': break;
|
||||
case 'M': state = EP_M; break;
|
||||
default: state = EP_IGNORE;
|
||||
default: state = EP_IGNORE;
|
||||
}
|
||||
break;
|
||||
|
||||
case EP_S: state = (c == '0' ? EP_S0 : EP_IGNORE); break;
|
||||
case EP_S0: state = (c == '0' ? EP_S00 : EP_IGNORE); break;
|
||||
case EP_S00: state = (c == '0' ? EP_grblSTATUS : EP_IGNORE); break;
|
||||
|
||||
case EP_R: state = (c == '0' ? EP_R0 : EP_IGNORE); break;
|
||||
case EP_R0: state = (c == '0' ? EP_R00 : EP_IGNORE); break;
|
||||
case EP_R00: state = (c == '0' ? EP_grblRESUME : EP_IGNORE); break;
|
||||
|
||||
case EP_P: state = (c == '0' ? EP_P0 : EP_IGNORE); break;
|
||||
case EP_P0: state = (c == '0' ? EP_P00 : EP_IGNORE); break;
|
||||
case EP_P00: state = (c == '0' ? EP_grblPAUSE : EP_IGNORE); break;
|
||||
|
||||
case EP_M:
|
||||
switch (c) {
|
||||
case ' ': break;
|
||||
|
|
@ -117,52 +127,35 @@ public:
|
|||
}
|
||||
break;
|
||||
|
||||
case EP_M10:
|
||||
state = (c == '8') ? EP_M108 : EP_IGNORE;
|
||||
break;
|
||||
|
||||
case EP_M11:
|
||||
state = (c == '2') ? EP_M112 : EP_IGNORE;
|
||||
break;
|
||||
|
||||
case EP_M4:
|
||||
state = (c == '1') ? EP_M41 : EP_IGNORE;
|
||||
break;
|
||||
|
||||
case EP_M41:
|
||||
state = (c == '0') ? EP_M410 : EP_IGNORE;
|
||||
break;
|
||||
case EP_M10: state = (c == '8') ? EP_M108 : EP_IGNORE; break;
|
||||
case EP_M11: state = (c == '2') ? EP_M112 : EP_IGNORE; break;
|
||||
case EP_M4: state = (c == '1') ? EP_M41 : EP_IGNORE; break;
|
||||
case EP_M41: state = (c == '0') ? EP_M410 : EP_IGNORE; break;
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
case EP_M8:
|
||||
state = (c == '7') ? EP_M87 : EP_IGNORE;
|
||||
break;
|
||||
|
||||
case EP_M87:
|
||||
state = (c == '6') ? EP_M876 : EP_IGNORE;
|
||||
break;
|
||||
case EP_M8: state = (c == '7') ? EP_M87 : EP_IGNORE; break;
|
||||
case EP_M87: state = (c == '6') ? EP_M876 : EP_IGNORE; break;
|
||||
|
||||
case EP_M876:
|
||||
switch (c) {
|
||||
case ' ': break;
|
||||
case 'S': state = EP_M876S; break;
|
||||
default: state = EP_IGNORE; break;
|
||||
}
|
||||
break;
|
||||
case EP_M876:
|
||||
switch (c) {
|
||||
case ' ': break;
|
||||
case 'S': state = EP_M876S; break;
|
||||
default: state = EP_IGNORE; break;
|
||||
}
|
||||
break;
|
||||
|
||||
case EP_M876S:
|
||||
switch (c) {
|
||||
case ' ': break;
|
||||
case '0': case '1': case '2':
|
||||
case '3': case '4': case '5':
|
||||
case '6': case '7': case '8':
|
||||
case '9':
|
||||
state = EP_M876SN;
|
||||
M876_reason = (uint8_t)(c - '0');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case EP_M876S:
|
||||
switch (c) {
|
||||
case ' ': break;
|
||||
case '0' ... '9':
|
||||
state = EP_M876SN;
|
||||
M876_reason = (uint8_t)(c - '0');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
#endif // HOST_PROMPT_SUPPORT
|
||||
|
||||
case EP_IGNORE:
|
||||
if (ISEOL(c)) state = EP_RESET;
|
||||
|
|
@ -177,6 +170,9 @@ public:
|
|||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
case EP_M876SN: host_response_handler(M876_reason); break;
|
||||
#endif
|
||||
case EP_grblSTATUS: report_current_position_moving(); break;
|
||||
case EP_grblPAUSE: quickpause_stepper(); break;
|
||||
case EP_grblRESUME: quickresume_stepper(); break;
|
||||
default: break;
|
||||
}
|
||||
state = EP_RESET;
|
||||
|
|
|
|||
|
|
@ -164,6 +164,9 @@
|
|||
*/
|
||||
G29_TYPE GcodeSuite::G29() {
|
||||
|
||||
M_State_grbl = M_PROBE;
|
||||
report_current_grblstate_moving();
|
||||
|
||||
reset_stepper_timeout();
|
||||
|
||||
const bool seenQ = EITHER(DEBUG_LEVELING_FEATURE, PROBE_MANUALLY) && parser.seen('Q');
|
||||
|
|
@ -898,6 +901,9 @@ G29_TYPE GcodeSuite::G29() {
|
|||
|
||||
report_current_position();
|
||||
|
||||
M_State_grbl = M_IDLE;
|
||||
report_current_grblstate_moving();
|
||||
|
||||
G29_RETURN(isnan(measured_z));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,9 @@ inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM("
|
|||
*/
|
||||
void GcodeSuite::G29() {
|
||||
|
||||
M_State_grbl = M_PROBE;
|
||||
report_current_grblstate_moving();
|
||||
|
||||
static int mbl_probe_index = -1;
|
||||
TERN_(HAS_SOFTWARE_ENDSTOPS, static bool saved_soft_endstops_state);
|
||||
|
||||
|
|
@ -197,6 +200,9 @@ void GcodeSuite::G29() {
|
|||
}
|
||||
|
||||
report_current_position();
|
||||
|
||||
M_State_grbl = M_IDLE;
|
||||
report_current_grblstate_moving();
|
||||
}
|
||||
|
||||
#endif // MESH_BED_LEVELING
|
||||
|
|
|
|||
|
|
@ -31,6 +31,18 @@
|
|||
#include "../../gcode.h"
|
||||
#include "../../../feature/bedlevel/bedlevel.h"
|
||||
|
||||
void GcodeSuite::G29() { ubl.G29(); }
|
||||
#include "../../../MarlinCore.h" // for M_State_grbl
|
||||
|
||||
void GcodeSuite::G29() {
|
||||
|
||||
M_State_grbl = M_PROBE;
|
||||
report_current_grblstate_moving();
|
||||
|
||||
ubl.G29();
|
||||
|
||||
M_State_grbl = M_IDLE;
|
||||
report_current_grblstate_moving();
|
||||
|
||||
}
|
||||
|
||||
#endif // AUTO_BED_LEVELING_UBL
|
||||
|
|
|
|||
|
|
@ -202,6 +202,9 @@ void GcodeSuite::G28() {
|
|||
|
||||
TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true);
|
||||
|
||||
M_State_grbl = M_HOMING;
|
||||
report_current_grblstate_moving();
|
||||
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
bool IDEX_saved_duplication_state = extruder_duplication_enabled;
|
||||
DualXMode IDEX_saved_mode = dual_x_carriage_mode;
|
||||
|
|
@ -464,6 +467,9 @@ void GcodeSuite::G28() {
|
|||
if (ENABLED(NANODLP_Z_SYNC) && (doZ || ENABLED(NANODLP_ALL_AXIS)))
|
||||
SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP);
|
||||
|
||||
M_State_grbl = M_IDLE;
|
||||
report_current_grblstate_moving();
|
||||
|
||||
#if HAS_L64XX
|
||||
// Set L6470 absolute position registers to counts
|
||||
// constexpr *might* move this to PROGMEM.
|
||||
|
|
|
|||
|
|
@ -385,6 +385,9 @@ static float auto_tune_a() {
|
|||
*/
|
||||
void GcodeSuite::G33() {
|
||||
|
||||
M_State_grbl = M_PROBE;
|
||||
report_current_grblstate_moving();
|
||||
|
||||
const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS);
|
||||
if (!WITHIN(probe_points, 0, 10)) {
|
||||
SERIAL_ECHOLNPGM("?(P)oints implausible (0-10).");
|
||||
|
|
@ -643,6 +646,9 @@ void GcodeSuite::G33() {
|
|||
while (((zero_std_dev < test_precision && iterations < 31) || iterations <= force_iterations) && zero_std_dev > calibration_precision);
|
||||
|
||||
ac_cleanup(TERN_(HAS_MULTI_HOTEND, old_tool_index));
|
||||
|
||||
M_State_grbl = M_IDLE;
|
||||
report_current_grblstate_moving();
|
||||
}
|
||||
|
||||
#endif // DELTA_AUTO_CALIBRATION
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ GcodeSuite gcode;
|
|||
#include "../feature/password/password.h"
|
||||
#endif
|
||||
|
||||
#include "../MarlinCore.h" // for idle()
|
||||
#include "../MarlinCore.h" // for idle(), M_State_grbl
|
||||
|
||||
// Inactivity shutdown
|
||||
millis_t GcodeSuite::previous_move_ms = 0,
|
||||
|
|
@ -82,6 +82,10 @@ uint8_t GcodeSuite::axis_relative = (
|
|||
#endif
|
||||
|
||||
#if ENABLED(HOST_KEEPALIVE_FEATURE)
|
||||
#if !KEEPALIVE_INTERVAL_DIVIDER
|
||||
#undef KEEPALIVE_INTERVAL_DIVIDER
|
||||
#define KEEPALIVE_INTERVAL_DIVIDER 1
|
||||
#endif
|
||||
GcodeSuite::MarlinBusyState GcodeSuite::busy_state = NOT_BUSY;
|
||||
uint8_t GcodeSuite::host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL;
|
||||
#endif
|
||||
|
|
@ -1017,18 +1021,23 @@ void GcodeSuite::process_subcommands_now(char * gcode) {
|
|||
case IN_HANDLER:
|
||||
case IN_PROCESS:
|
||||
SERIAL_ECHO_MSG(STR_BUSY_PROCESSING);
|
||||
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_position_moving());
|
||||
break;
|
||||
case PAUSED_FOR_USER:
|
||||
SERIAL_ECHO_MSG(STR_BUSY_PAUSED_FOR_USER);
|
||||
M_State_grbl = M_HOLD;
|
||||
report_current_grblstate_moving();
|
||||
break;
|
||||
case PAUSED_FOR_INPUT:
|
||||
SERIAL_ECHO_MSG(STR_BUSY_PAUSED_FOR_INPUT);
|
||||
M_State_grbl = M_HOLD;
|
||||
report_current_grblstate_moving();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
next_busy_signal_ms = ms + SEC_TO_MS(host_keepalive_interval);
|
||||
next_busy_signal_ms = ms + SEC_TO_MS(host_keepalive_interval) / (KEEPALIVE_INTERVAL_DIVIDER);
|
||||
}
|
||||
|
||||
#endif // HOST_KEEPALIVE_FEATURE
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@
|
|||
const xyze_float_t diff = from_steppers - leveled;
|
||||
SERIAL_ECHOPGM("Diff: ");
|
||||
report_xyze(diff);
|
||||
report_current_grblstate_moving();
|
||||
}
|
||||
|
||||
#endif // M114_DETAIL
|
||||
|
|
@ -216,4 +217,5 @@ void GcodeSuite::M114() {
|
|||
|
||||
TERN_(M114_LEGACY, planner.synchronize());
|
||||
report_current_position_projected();
|
||||
report_current_grblstate_moving();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ void GcodeSuite::G0_G1(
|
|||
| (parser.seen('Z') ? _BV(Z_AXIS) : 0) )
|
||||
#endif
|
||||
) {
|
||||
M_State_grbl = M_RUNNING;
|
||||
report_current_grblstate_moving();
|
||||
|
||||
#ifdef G0_FEEDRATE
|
||||
feedRate_t old_feedrate;
|
||||
|
|
@ -121,5 +123,10 @@ void GcodeSuite::G0_G1(
|
|||
SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(FULL_REPORT_TO_HOST_FEATURE)
|
||||
TERN_(NANODLP_Z_SYNC, M_State_grbl = M_IDLE);
|
||||
report_current_position_moving();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,6 +274,8 @@ void plan_arc(
|
|||
*/
|
||||
void GcodeSuite::G2_G3(const bool clockwise) {
|
||||
if (MOTION_CONDITIONS) {
|
||||
M_State_grbl = M_RUNNING;
|
||||
report_current_grblstate_moving();
|
||||
|
||||
#if ENABLED(SF_ARC_FIX)
|
||||
const bool relative_mode_backup = relative_mode;
|
||||
|
|
@ -334,6 +336,9 @@ void GcodeSuite::G2_G3(const bool clockwise) {
|
|||
}
|
||||
else
|
||||
SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS);
|
||||
|
||||
M_State_grbl = M_IDLE;
|
||||
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_position_moving());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ void GCodeParser::parse(char *p) {
|
|||
#if ENABLED(EXPECTED_PRINTER_CHECK)
|
||||
case 16:
|
||||
#endif
|
||||
case 23: case 28: case 30: case 117: case 118: case 928:
|
||||
case 23: case 28: case 30: case 117 ... 118: case 928:
|
||||
string_arg = unescape_string(p);
|
||||
return;
|
||||
default: break;
|
||||
|
|
|
|||
|
|
@ -245,6 +245,48 @@ void report_current_position_projected() {
|
|||
stepper.report_a_position(planner.position);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the current position (processed) to serial while moving
|
||||
*/
|
||||
void report_current_position_moving() {
|
||||
|
||||
get_cartesian_from_steppers();
|
||||
const xyz_pos_t lpos = cartes.asLogical();
|
||||
SERIAL_ECHOPAIR("X:", lpos.x, " Y:", lpos.y, " Z:", lpos.z, " E:", current_position.e);
|
||||
|
||||
stepper.report_positions();
|
||||
#if IS_SCARA
|
||||
scara_report_positions();
|
||||
#endif
|
||||
report_current_grblstate_moving();
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the current grbl compatible state to serial while moving
|
||||
*/
|
||||
void report_current_grblstate_moving() {
|
||||
#if ENABLED(FULL_REPORT_TO_HOST_FEATURE)
|
||||
SERIAL_ECHOPAIR("S_XYZ:", M_State_grbl);
|
||||
SERIAL_EOL();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* grbl compatible state to marlin_state
|
||||
*/
|
||||
void set_M_state_from_marlin_state() {
|
||||
switch (marlin_state) {
|
||||
case MF_INITIALIZING: M_State_grbl = M_INIT; break;
|
||||
case MF_SD_COMPLETE: M_State_grbl = M_ALARM; break;
|
||||
case MF_WAITING: M_State_grbl = M_IDLE; break;
|
||||
case MF_STOPPED: M_State_grbl = M_END; break;
|
||||
case MF_RUNNING: M_State_grbl = M_RUNNING; break;
|
||||
case MF_PAUSED: M_State_grbl = M_HOLD; break;
|
||||
case MF_KILLED: M_State_grbl = M_ERROR; break;
|
||||
default: M_State_grbl = M_IDLE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* sync_plan_position
|
||||
*
|
||||
|
|
|
|||
|
|
@ -172,6 +172,9 @@ typedef struct { xyz_pos_t min, max; } axis_limits_t;
|
|||
void report_real_position();
|
||||
void report_current_position();
|
||||
void report_current_position_projected();
|
||||
void report_current_position_moving();
|
||||
void report_current_grblstate_moving();
|
||||
void set_M_state_from_marlin_state();
|
||||
|
||||
void get_cartesian_from_steppers();
|
||||
void set_current_from_steppers_for_axis(const AxisEnum axis);
|
||||
|
|
|
|||
|
|
@ -1593,6 +1593,23 @@ void Planner::quick_stop() {
|
|||
stepper.quick_stop();
|
||||
}
|
||||
|
||||
void Planner::quick_pause() {
|
||||
// Suspend until quick_resume is called
|
||||
// Don't empty buffers or queues
|
||||
if (stepper.suspend()) {
|
||||
M_State_grbl = M_HOLD;
|
||||
report_current_grblstate_moving();
|
||||
}
|
||||
}
|
||||
|
||||
void Planner::quick_resume() {
|
||||
// Resume if suspended
|
||||
set_M_state_from_marlin_state();
|
||||
report_current_grblstate_moving();
|
||||
stepper.wake_up();
|
||||
}
|
||||
|
||||
|
||||
void Planner::endstop_triggered(const AxisEnum axis) {
|
||||
// Record stepper position and discard the current block
|
||||
stepper.endstop_triggered(axis);
|
||||
|
|
|
|||
|
|
@ -829,6 +829,11 @@ class Planner {
|
|||
// a Full Shutdown is required, or when endstops are hit)
|
||||
static void quick_stop();
|
||||
|
||||
// Force a quick pause of the machine (for example, when a pause
|
||||
// is required in the middle of move)
|
||||
static void quick_pause();
|
||||
static void quick_resume();
|
||||
|
||||
// Called when an endstop is triggered. Causes the machine to stop inmediately
|
||||
static void endstop_triggered(const AxisEnum axis);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue