✨ EP_BABYSTEPPING (#25869)
This commit is contained in:
parent
1a4e208c69
commit
772e19aab9
|
@ -1543,7 +1543,7 @@
|
||||||
*/
|
*/
|
||||||
#define SHOW_BOOTSCREEN // Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
|
#define SHOW_BOOTSCREEN // Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
|
||||||
#if ENABLED(SHOW_BOOTSCREEN)
|
#if ENABLED(SHOW_BOOTSCREEN)
|
||||||
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
|
#define BOOTSCREEN_TIMEOUT 3000 // (ms) Total Duration to display the boot screen(s)
|
||||||
#if EITHER(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI)
|
#if EITHER(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI)
|
||||||
#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash)
|
#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash)
|
||||||
#endif
|
#endif
|
||||||
|
@ -2190,9 +2190,10 @@
|
||||||
*/
|
*/
|
||||||
//#define BABYSTEPPING
|
//#define BABYSTEPPING
|
||||||
#if ENABLED(BABYSTEPPING)
|
#if ENABLED(BABYSTEPPING)
|
||||||
//#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
|
//#define INTEGRATED_BABYSTEPPING // Integration of babystepping into the Stepper ISR
|
||||||
|
//#define EP_BABYSTEPPING // M293/M294 babystepping with EMERGENCY_PARSER support
|
||||||
//#define BABYSTEP_WITHOUT_HOMING
|
//#define BABYSTEP_WITHOUT_HOMING
|
||||||
//#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement).
|
//#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement)
|
||||||
//#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA!
|
//#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA!
|
||||||
//#define BABYSTEP_INVERT_Z // Enable if Z babysteps should go the other way
|
//#define BABYSTEP_INVERT_Z // Enable if Z babysteps should go the other way
|
||||||
//#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps
|
//#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps
|
||||||
|
|
|
@ -726,6 +726,10 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if BOTH(EP_BABYSTEPPING, EMERGENCY_PARSER)
|
||||||
|
#include "feature/babystep.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard idle routine keeps the machine alive:
|
* Standard idle routine keeps the machine alive:
|
||||||
* - Core Marlin activities
|
* - Core Marlin activities
|
||||||
|
@ -848,6 +852,11 @@ void idle(const bool no_stepper_sleep/*=false*/) {
|
||||||
// Handle Joystick jogging
|
// Handle Joystick jogging
|
||||||
TERN_(POLL_JOG, joystick.inject_jog_moves());
|
TERN_(POLL_JOG, joystick.inject_jog_moves());
|
||||||
|
|
||||||
|
// Async Babystepping via the Emergency Parser
|
||||||
|
#if BOTH(EP_BABYSTEPPING, EMERGENCY_PARSER)
|
||||||
|
babystep.do_ep_steps();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Direct Stepping
|
// Direct Stepping
|
||||||
TERN_(DIRECT_STEPPING, page_manager.write_responses());
|
TERN_(DIRECT_STEPPING, page_manager.write_responses());
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "babystep.h"
|
#include "babystep.h"
|
||||||
#include "../MarlinCore.h"
|
#include "../MarlinCore.h"
|
||||||
#include "../module/motion.h" // for axes_should_home()
|
#include "../module/motion.h" // for axes_should_home(), BABYSTEP_ALLOWED
|
||||||
#include "../module/planner.h" // for axis_steps_per_mm[]
|
#include "../module/planner.h" // for axis_steps_per_mm[]
|
||||||
#include "../module/stepper.h"
|
#include "../module/stepper.h"
|
||||||
|
|
||||||
|
@ -42,6 +42,10 @@ volatile int16_t Babystep::steps[BS_AXIS_IND(Z_AXIS) + 1];
|
||||||
#endif
|
#endif
|
||||||
int16_t Babystep::accum;
|
int16_t Babystep::accum;
|
||||||
|
|
||||||
|
#if BOTH(EP_BABYSTEPPING, EMERGENCY_PARSER)
|
||||||
|
int16_t Babystep::ep_babysteps;
|
||||||
|
#endif
|
||||||
|
|
||||||
void Babystep::step_axis(const AxisEnum axis) {
|
void Babystep::step_axis(const AxisEnum axis) {
|
||||||
const int16_t curTodo = steps[BS_AXIS_IND(axis)]; // get rid of volatile for performance
|
const int16_t curTodo = steps[BS_AXIS_IND(axis)]; // get rid of volatile for performance
|
||||||
if (curTodo) {
|
if (curTodo) {
|
||||||
|
@ -76,4 +80,10 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
|
||||||
TERN_(INTEGRATED_BABYSTEPPING, if (has_steps()) stepper.initiateBabystepping());
|
TERN_(INTEGRATED_BABYSTEPPING, if (has_steps()) stepper.initiateBabystepping());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLED(EP_BABYSTEPPING)
|
||||||
|
// Step Z for M293 / M294
|
||||||
|
void Babystep::z_up() { if (BABYSTEP_ALLOWED()) add_steps(Z_AXIS, +BABYSTEP_SIZE_Z); }
|
||||||
|
void Babystep::z_down() { if (BABYSTEP_ALLOWED()) add_steps(Z_AXIS, -BABYSTEP_SIZE_Z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // BABYSTEPPING
|
#endif // BABYSTEPPING
|
||||||
|
|
|
@ -52,6 +52,10 @@ public:
|
||||||
static volatile int16_t steps[BS_AXIS_IND(Z_AXIS) + 1];
|
static volatile int16_t steps[BS_AXIS_IND(Z_AXIS) + 1];
|
||||||
static int16_t accum; // Total babysteps in current edit
|
static int16_t accum; // Total babysteps in current edit
|
||||||
|
|
||||||
|
#if BOTH(EP_BABYSTEPPING, EMERGENCY_PARSER)
|
||||||
|
static int16_t ep_babysteps;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
||||||
static int16_t axis_total[BS_TOTAL_IND(Z_AXIS) + 1]; // Total babysteps since G28
|
static int16_t axis_total[BS_TOTAL_IND(Z_AXIS) + 1]; // Total babysteps since G28
|
||||||
static void reset_total(const AxisEnum axis) {
|
static void reset_total(const AxisEnum axis) {
|
||||||
|
@ -63,6 +67,21 @@ public:
|
||||||
static void add_steps(const AxisEnum axis, const int16_t distance);
|
static void add_steps(const AxisEnum axis, const int16_t distance);
|
||||||
static void add_mm(const AxisEnum axis, const_float_t mm);
|
static void add_mm(const AxisEnum axis, const_float_t mm);
|
||||||
|
|
||||||
|
#if ENABLED(EP_BABYSTEPPING)
|
||||||
|
// Step Z for M293 / M294
|
||||||
|
static void z_up();
|
||||||
|
static void z_down();
|
||||||
|
#if ENABLED(EMERGENCY_PARSER)
|
||||||
|
// Step Z according to steps accumulated by the EP
|
||||||
|
FORCE_INLINE static void do_ep_steps() {
|
||||||
|
if (ep_babysteps) {
|
||||||
|
if (ep_babysteps > 0) { z_up(); ep_babysteps--; }
|
||||||
|
else { z_down(); ep_babysteps++; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif // EP_BABYSTEPPING
|
||||||
|
|
||||||
#if ENABLED(BD_SENSOR)
|
#if ENABLED(BD_SENSOR)
|
||||||
static void set_mm(const AxisEnum axis, const_float_t mm);
|
static void set_mm(const AxisEnum axis, const_float_t mm);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
* e_parser.cpp - Intercept special commands directly in the serial stream
|
* e_parser.cpp - Intercept special commands directly in the serial stream
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../inc/MarlinConfigPre.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(EMERGENCY_PARSER)
|
#if ENABLED(EMERGENCY_PARSER)
|
||||||
|
|
||||||
|
@ -39,10 +39,193 @@ bool EmergencyParser::killed_by_M112, // = false
|
||||||
EmergencyParser::enabled;
|
EmergencyParser::enabled;
|
||||||
|
|
||||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||||
|
#include "host_actions.h"
|
||||||
uint8_t EmergencyParser::M876_reason; // = 0
|
uint8_t EmergencyParser::M876_reason; // = 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Global instance
|
// Global instance
|
||||||
EmergencyParser emergency_parser;
|
EmergencyParser emergency_parser;
|
||||||
|
|
||||||
|
// External references
|
||||||
|
extern bool wait_for_user, wait_for_heatup;
|
||||||
|
|
||||||
|
#if ENABLED(EP_BABYSTEPPING)
|
||||||
|
#include "babystep.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(REALTIME_REPORTING_COMMANDS)
|
||||||
|
// From motion.h, which cannot be included here
|
||||||
|
void report_current_position_moving();
|
||||||
|
void quickpause_stepper();
|
||||||
|
void quickresume_stepper();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void EmergencyParser::update(EmergencyParser::State &state, const uint8_t c) {
|
||||||
|
switch (state) {
|
||||||
|
case EP_RESET:
|
||||||
|
switch (c) {
|
||||||
|
case ' ': case '\n': case '\r': break;
|
||||||
|
case 'N': state = EP_N; break;
|
||||||
|
case 'M': state = EP_M; break;
|
||||||
|
#if ENABLED(REALTIME_REPORTING_COMMANDS)
|
||||||
|
case 'S': state = EP_S; break;
|
||||||
|
case 'P': state = EP_P; break;
|
||||||
|
case 'R': state = EP_R; break;
|
||||||
|
#endif
|
||||||
|
#if ENABLED(SOFT_RESET_VIA_SERIAL)
|
||||||
|
case '^': state = EP_ctrl; break;
|
||||||
|
case 'K': state = EP_K; break;
|
||||||
|
#endif
|
||||||
|
default: state = EP_IGNORE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EP_N:
|
||||||
|
switch (c) {
|
||||||
|
case '0' ... '9':
|
||||||
|
case '-': case ' ': break;
|
||||||
|
case 'M': state = EP_M; break;
|
||||||
|
#if ENABLED(REALTIME_REPORTING_COMMANDS)
|
||||||
|
case 'S': state = EP_S; break;
|
||||||
|
case 'P': state = EP_P; break;
|
||||||
|
case 'R': state = EP_R; break;
|
||||||
|
#endif
|
||||||
|
default: state = EP_IGNORE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
#if ENABLED(REALTIME_REPORTING_COMMANDS)
|
||||||
|
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_GRBL_STATUS : 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_GRBL_RESUME : 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_GRBL_PAUSE : EP_IGNORE; break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(SOFT_RESET_VIA_SERIAL)
|
||||||
|
case EP_ctrl: state = (c == 'X') ? EP_KILL : EP_IGNORE; break;
|
||||||
|
case EP_K: state = (c == 'I') ? EP_KI : EP_IGNORE; break;
|
||||||
|
case EP_KI: state = (c == 'L') ? EP_KIL : EP_IGNORE; break;
|
||||||
|
case EP_KIL: state = (c == 'L') ? EP_KILL : EP_IGNORE; break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
case EP_M:
|
||||||
|
switch (c) {
|
||||||
|
case ' ': break;
|
||||||
|
case '1': state = EP_M1; break;
|
||||||
|
#if ENABLED(EP_BABYSTEPPING)
|
||||||
|
case '2': state = EP_M2; break;
|
||||||
|
#endif
|
||||||
|
case '4': state = EP_M4; break;
|
||||||
|
#if HAS_MEDIA
|
||||||
|
case '5': state = EP_M5; break;
|
||||||
|
#endif
|
||||||
|
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||||
|
case '8': state = EP_M8; break;
|
||||||
|
#endif
|
||||||
|
default: state = EP_IGNORE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EP_M1:
|
||||||
|
switch (c) {
|
||||||
|
case '0': state = EP_M10; break;
|
||||||
|
case '1': state = EP_M11; break;
|
||||||
|
default: state = 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 HAS_MEDIA
|
||||||
|
case EP_M5: state = (c == '2') ? EP_M52 : EP_IGNORE; break;
|
||||||
|
case EP_M52: state = (c == '4') ? EP_M524 : EP_IGNORE; break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(EP_BABYSTEPPING)
|
||||||
|
case EP_M2:
|
||||||
|
switch (c) {
|
||||||
|
case '9': state = EP_M29; break;
|
||||||
|
default: state = EP_IGNORE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EP_M29:
|
||||||
|
switch (c) {
|
||||||
|
case '3': state = EP_M293; break;
|
||||||
|
case '4': state = EP_M294; break;
|
||||||
|
default: state = EP_IGNORE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#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_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' ... '9':
|
||||||
|
state = EP_M876SN;
|
||||||
|
M876_reason = uint8_t(c - '0');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
case EP_IGNORE:
|
||||||
|
if (ISEOL(c)) state = EP_RESET;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (ISEOL(c)) {
|
||||||
|
if (enabled) switch (state) {
|
||||||
|
case EP_M108: wait_for_user = wait_for_heatup = false; break;
|
||||||
|
case EP_M112: killed_by_M112 = true; break;
|
||||||
|
case EP_M410: quickstop_by_M410 = true; break;
|
||||||
|
#if ENABLED(EP_BABYSTEPPING)
|
||||||
|
case EP_M293: babystep.ep_babysteps++; break;
|
||||||
|
case EP_M294: babystep.ep_babysteps--; break;
|
||||||
|
#endif
|
||||||
|
#if HAS_MEDIA
|
||||||
|
case EP_M524: sd_abort_by_M524 = true; break;
|
||||||
|
#endif
|
||||||
|
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||||
|
case EP_M876SN: hostui.handle_response(M876_reason); break;
|
||||||
|
#endif
|
||||||
|
#if ENABLED(REALTIME_REPORTING_COMMANDS)
|
||||||
|
case EP_GRBL_STATUS: report_current_position_moving(); break;
|
||||||
|
case EP_GRBL_PAUSE: quickpause_stepper(); break;
|
||||||
|
case EP_GRBL_RESUME: quickresume_stepper(); break;
|
||||||
|
#endif
|
||||||
|
#if ENABLED(SOFT_RESET_VIA_SERIAL)
|
||||||
|
case EP_KILL: hal.reboot(); break;
|
||||||
|
#endif
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
state = EP_RESET;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif // EMERGENCY_PARSER
|
#endif // EMERGENCY_PARSER
|
||||||
|
|
|
@ -27,24 +27,6 @@
|
||||||
|
|
||||||
#include "../inc/MarlinConfigPre.h"
|
#include "../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
|
||||||
#include "host_actions.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// External references
|
|
||||||
extern bool wait_for_user, wait_for_heatup;
|
|
||||||
|
|
||||||
#if ENABLED(REALTIME_REPORTING_COMMANDS)
|
|
||||||
// From motion.h, which cannot be included here
|
|
||||||
void report_current_position_moving();
|
|
||||||
void quickpause_stepper();
|
|
||||||
void quickresume_stepper();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ENABLED(SOFT_RESET_VIA_SERIAL)
|
|
||||||
void HAL_reboot();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class EmergencyParser {
|
class EmergencyParser {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -61,6 +43,9 @@ public:
|
||||||
#if HAS_MEDIA
|
#if HAS_MEDIA
|
||||||
EP_M5, EP_M52, EP_M524,
|
EP_M5, EP_M52, EP_M524,
|
||||||
#endif
|
#endif
|
||||||
|
#if ENABLED(EP_BABYSTEPPING)
|
||||||
|
EP_M2, EP_M29, EP_M293, EP_M294,
|
||||||
|
#endif
|
||||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
#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
|
#endif
|
||||||
|
@ -92,149 +77,7 @@ public:
|
||||||
FORCE_INLINE static void enable() { enabled = true; }
|
FORCE_INLINE static void enable() { enabled = true; }
|
||||||
FORCE_INLINE static void disable() { enabled = false; }
|
FORCE_INLINE static void disable() { enabled = false; }
|
||||||
|
|
||||||
FORCE_INLINE static void update(State &state, const uint8_t c) {
|
static void update(State &state, const uint8_t c);
|
||||||
switch (state) {
|
|
||||||
case EP_RESET:
|
|
||||||
switch (c) {
|
|
||||||
case ' ': case '\n': case '\r': break;
|
|
||||||
case 'N': state = EP_N; break;
|
|
||||||
case 'M': state = EP_M; break;
|
|
||||||
#if ENABLED(REALTIME_REPORTING_COMMANDS)
|
|
||||||
case 'S': state = EP_S; break;
|
|
||||||
case 'P': state = EP_P; break;
|
|
||||||
case 'R': state = EP_R; break;
|
|
||||||
#endif
|
|
||||||
#if ENABLED(SOFT_RESET_VIA_SERIAL)
|
|
||||||
case '^': state = EP_ctrl; break;
|
|
||||||
case 'K': state = EP_K; break;
|
|
||||||
#endif
|
|
||||||
default: state = EP_IGNORE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EP_N:
|
|
||||||
switch (c) {
|
|
||||||
case '0' ... '9':
|
|
||||||
case '-': case ' ': break;
|
|
||||||
case 'M': state = EP_M; break;
|
|
||||||
#if ENABLED(REALTIME_REPORTING_COMMANDS)
|
|
||||||
case 'S': state = EP_S; break;
|
|
||||||
case 'P': state = EP_P; break;
|
|
||||||
case 'R': state = EP_R; break;
|
|
||||||
#endif
|
|
||||||
default: state = EP_IGNORE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if ENABLED(REALTIME_REPORTING_COMMANDS)
|
|
||||||
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_GRBL_STATUS : 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_GRBL_RESUME : 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_GRBL_PAUSE : EP_IGNORE; break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ENABLED(SOFT_RESET_VIA_SERIAL)
|
|
||||||
case EP_ctrl: state = (c == 'X') ? EP_KILL : EP_IGNORE; break;
|
|
||||||
case EP_K: state = (c == 'I') ? EP_KI : EP_IGNORE; break;
|
|
||||||
case EP_KI: state = (c == 'L') ? EP_KIL : EP_IGNORE; break;
|
|
||||||
case EP_KIL: state = (c == 'L') ? EP_KILL : EP_IGNORE; break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case EP_M:
|
|
||||||
switch (c) {
|
|
||||||
case ' ': break;
|
|
||||||
case '1': state = EP_M1; break;
|
|
||||||
case '4': state = EP_M4; break;
|
|
||||||
#if HAS_MEDIA
|
|
||||||
case '5': state = EP_M5; break;
|
|
||||||
#endif
|
|
||||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
|
||||||
case '8': state = EP_M8; break;
|
|
||||||
#endif
|
|
||||||
default: state = EP_IGNORE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EP_M1:
|
|
||||||
switch (c) {
|
|
||||||
case '0': state = EP_M10; break;
|
|
||||||
case '1': state = EP_M11; break;
|
|
||||||
default: state = 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 HAS_MEDIA
|
|
||||||
case EP_M5: state = (c == '2') ? EP_M52 : EP_IGNORE; break;
|
|
||||||
case EP_M52: state = (c == '4') ? EP_M524 : EP_IGNORE; break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#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_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' ... '9':
|
|
||||||
state = EP_M876SN;
|
|
||||||
M876_reason = uint8_t(c - '0');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case EP_IGNORE:
|
|
||||||
if (ISEOL(c)) state = EP_RESET;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
if (ISEOL(c)) {
|
|
||||||
if (enabled) switch (state) {
|
|
||||||
case EP_M108: wait_for_user = wait_for_heatup = false; break;
|
|
||||||
case EP_M112: killed_by_M112 = true; break;
|
|
||||||
case EP_M410: quickstop_by_M410 = true; break;
|
|
||||||
#if HAS_MEDIA
|
|
||||||
case EP_M524: sd_abort_by_M524 = true; break;
|
|
||||||
#endif
|
|
||||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
|
||||||
case EP_M876SN: hostui.handle_response(M876_reason); break;
|
|
||||||
#endif
|
|
||||||
#if ENABLED(REALTIME_REPORTING_COMMANDS)
|
|
||||||
case EP_GRBL_STATUS: report_current_position_moving(); break;
|
|
||||||
case EP_GRBL_PAUSE: quickpause_stepper(); break;
|
|
||||||
case EP_GRBL_RESUME: quickresume_stepper(); break;
|
|
||||||
#endif
|
|
||||||
#if ENABLED(SOFT_RESET_VIA_SERIAL)
|
|
||||||
case EP_KILL: HAL_reboot(); break;
|
|
||||||
#endif
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
state = EP_RESET;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool enabled;
|
static bool enabled;
|
||||||
|
|
|
@ -757,6 +757,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||||
|
|
||||||
#if ENABLED(BABYSTEPPING)
|
#if ENABLED(BABYSTEPPING)
|
||||||
case 290: M290(); break; // M290: Babystepping
|
case 290: M290(); break; // M290: Babystepping
|
||||||
|
#if ENABLED(EP_BABYSTEPPING)
|
||||||
|
case 293: IF_DISABLED(EMERGENCY_PARSER, M293()); break; // M293: Babystep up
|
||||||
|
case 294: IF_DISABLED(EMERGENCY_PARSER, M294()); break; // M294: Babystep down
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_SOUND
|
#if HAS_SOUND
|
||||||
|
|
|
@ -930,6 +930,10 @@ private:
|
||||||
|
|
||||||
#if ENABLED(BABYSTEPPING)
|
#if ENABLED(BABYSTEPPING)
|
||||||
static void M290();
|
static void M290();
|
||||||
|
#if ENABLED(EP_BABYSTEPPING)
|
||||||
|
static void M293();
|
||||||
|
static void M294();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_SOUND
|
#if HAS_SOUND
|
||||||
|
|
|
@ -54,6 +54,9 @@
|
||||||
* M115: Capabilities string and extended capabilities report
|
* M115: Capabilities string and extended capabilities report
|
||||||
* If a capability is not reported, hosts should assume
|
* If a capability is not reported, hosts should assume
|
||||||
* the capability is not present.
|
* the capability is not present.
|
||||||
|
*
|
||||||
|
* NOTE: Always make sure to add new capabilities to the RepRap Wiki
|
||||||
|
* at https://reprap.org/wiki/Firmware_Capabilities_Protocol
|
||||||
*/
|
*/
|
||||||
void GcodeSuite::M115() {
|
void GcodeSuite::M115() {
|
||||||
SERIAL_ECHOPGM("FIRMWARE_NAME:Marlin"
|
SERIAL_ECHOPGM("FIRMWARE_NAME:Marlin"
|
||||||
|
@ -201,6 +204,9 @@ void GcodeSuite::M115() {
|
||||||
// BABYSTEPPING (M290)
|
// BABYSTEPPING (M290)
|
||||||
cap_line(F("BABYSTEPPING"), ENABLED(BABYSTEPPING));
|
cap_line(F("BABYSTEPPING"), ENABLED(BABYSTEPPING));
|
||||||
|
|
||||||
|
// EP_BABYSTEP (M293, M294)
|
||||||
|
cap_line(F("EP_BABYSTEP"), ENABLED(EP_BABYSTEPPING));
|
||||||
|
|
||||||
// CHAMBER_TEMPERATURE (M141, M191)
|
// CHAMBER_TEMPERATURE (M141, M191)
|
||||||
cap_line(F("CHAMBER_TEMPERATURE"), ENABLED(HAS_HEATED_CHAMBER));
|
cap_line(F("CHAMBER_TEMPERATURE"), ENABLED(HAS_HEATED_CHAMBER));
|
||||||
|
|
||||||
|
|
|
@ -131,4 +131,10 @@ void GcodeSuite::M290() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLED(EP_BABYSTEPPING) && DISABLED(EMERGENCY_PARSER)
|
||||||
|
// Without Emergency Parser M293/M294 will be added to the queue
|
||||||
|
void GcodeSuite::M293() { babystep.z_up(); }
|
||||||
|
void GcodeSuite::M294() { babystep.z_down(); }
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // BABYSTEPPING
|
#endif // BABYSTEPPING
|
||||||
|
|
|
@ -729,6 +729,13 @@
|
||||||
#warning "BABYSTEPPING is recommended with BD_SENSOR."
|
#warning "BABYSTEPPING is recommended with BD_SENSOR."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EP Babystepping works best with EMERGENCY_PARSER
|
||||||
|
*/
|
||||||
|
#if ENABLED(EP_BABYSTEPPING) && DISABLED(EMERGENCY_PARSER)
|
||||||
|
#warning "EMERGENCY_PARSER is recommended for EP_BABYSTEPPING."
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POLAR warnings
|
* POLAR warnings
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -242,17 +242,6 @@ void _lcd_draw_homing();
|
||||||
#else
|
#else
|
||||||
void lcd_babystep_z();
|
void lcd_babystep_z();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(BABYSTEP_MILLIMETER_UNITS)
|
|
||||||
#define BABYSTEP_SIZE_X int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[X_AXIS])
|
|
||||||
#define BABYSTEP_SIZE_Y int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[Y_AXIS])
|
|
||||||
#define BABYSTEP_SIZE_Z int32_t((BABYSTEP_MULTIPLICATOR_Z) * planner.settings.axis_steps_per_mm[Z_AXIS])
|
|
||||||
#else
|
|
||||||
#define BABYSTEP_SIZE_X BABYSTEP_MULTIPLICATOR_XY
|
|
||||||
#define BABYSTEP_SIZE_Y BABYSTEP_MULTIPLICATOR_XY
|
|
||||||
#define BABYSTEP_SIZE_Z BABYSTEP_MULTIPLICATOR_Z
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
|
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
|
||||||
|
|
|
@ -88,6 +88,18 @@
|
||||||
MMM_TO_MMS(manual_feedrate_mm_m.u), MMM_TO_MMS(manual_feedrate_mm_m.v), MMM_TO_MMS(manual_feedrate_mm_m.w));
|
MMM_TO_MMS(manual_feedrate_mm_m.u), MMM_TO_MMS(manual_feedrate_mm_m.v), MMM_TO_MMS(manual_feedrate_mm_m.w));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(BABYSTEPPING)
|
||||||
|
#if ENABLED(BABYSTEP_MILLIMETER_UNITS)
|
||||||
|
#define BABYSTEP_SIZE_X int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[X_AXIS])
|
||||||
|
#define BABYSTEP_SIZE_Y int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[Y_AXIS])
|
||||||
|
#define BABYSTEP_SIZE_Z int32_t((BABYSTEP_MULTIPLICATOR_Z) * planner.settings.axis_steps_per_mm[Z_AXIS])
|
||||||
|
#else
|
||||||
|
#define BABYSTEP_SIZE_X BABYSTEP_MULTIPLICATOR_XY
|
||||||
|
#define BABYSTEP_SIZE_Y BABYSTEP_MULTIPLICATOR_XY
|
||||||
|
#define BABYSTEP_SIZE_Z BABYSTEP_MULTIPLICATOR_Z
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if IS_KINEMATIC && HAS_JUNCTION_DEVIATION
|
#if IS_KINEMATIC && HAS_JUNCTION_DEVIATION
|
||||||
#define HAS_DIST_MM_ARG 1
|
#define HAS_DIST_MM_ARG 1
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -44,7 +44,7 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER ADAPTIVE_FAN_SLOWING TE
|
||||||
FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \
|
FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \
|
||||||
NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR PREHEAT_BEFORE_LEVELING G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
|
NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR PREHEAT_BEFORE_LEVELING G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
|
||||||
ASSISTED_TRAMMING ASSISTED_TRAMMING_WIZARD REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \
|
ASSISTED_TRAMMING ASSISTED_TRAMMING_WIZARD REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \
|
||||||
BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
|
BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET EP_BABYSTEPPING BABYSTEP_GFX_OVERLAY \
|
||||||
PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \
|
PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \
|
||||||
Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \
|
Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \
|
||||||
HOST_KEEPALIVE_FEATURE HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT \
|
HOST_KEEPALIVE_FEATURE HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT \
|
||||||
|
|
|
@ -30,7 +30,7 @@ opt_enable AUTO_BED_LEVELING_UBL AVOID_OBSTACLES RESTORE_LEVELING_AFTER_G28 DEBU
|
||||||
REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI STATUS_MESSAGE_SCROLLING SHOW_CUSTOM_BOOTSCREEN BOOT_MARLIN_LOGO_SMALL \
|
REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI STATUS_MESSAGE_SCROLLING SHOW_CUSTOM_BOOTSCREEN BOOT_MARLIN_LOGO_SMALL \
|
||||||
SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT AUTO_REPORT_SD_STATUS SCROLL_LONG_FILENAMES MEDIA_MENU_AT_TOP \
|
SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT AUTO_REPORT_SD_STATUS SCROLL_LONG_FILENAMES MEDIA_MENU_AT_TOP \
|
||||||
EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_MENU_MAIN FREEZE_FEATURE CANCEL_OBJECTS SOUND_MENU_ITEM \
|
EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_MENU_MAIN FREEZE_FEATURE CANCEL_OBJECTS SOUND_MENU_ITEM \
|
||||||
MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE ADVANCE_K_EXTRA QUICK_HOME \
|
EMERGENCY_PARSER MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE ADVANCE_K_EXTRA QUICK_HOME \
|
||||||
SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \
|
SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \
|
||||||
ENCODER_NOISE_FILTER BABYSTEPPING BABYSTEP_XY NANODLP_Z_SYNC I2C_POSITION_ENCODERS M114_DETAIL
|
ENCODER_NOISE_FILTER BABYSTEPPING BABYSTEP_XY NANODLP_Z_SYNC I2C_POSITION_ENCODERS M114_DETAIL
|
||||||
exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE ..." "$3"
|
exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE ..." "$3"
|
||||||
|
|
|
@ -43,7 +43,7 @@ debug_build_flags = -fstack-protector-strong -g -g3 -ggdb
|
||||||
lib_compat_mode = off
|
lib_compat_mode = off
|
||||||
build_src_filter = ${common.default_src_filter} +<src/HAL/NATIVE_SIM>
|
build_src_filter = ${common.default_src_filter} +<src/HAL/NATIVE_SIM>
|
||||||
lib_deps = ${common.lib_deps}
|
lib_deps = ${common.lib_deps}
|
||||||
MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/refs/heads/bugfix-2.1.x.zip
|
MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/bugfix-2.1.x.zip
|
||||||
Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/marlin_sim_native.zip
|
Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/marlin_sim_native.zip
|
||||||
LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/master.zip
|
LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/master.zip
|
||||||
extra_scripts = ${common.extra_scripts}
|
extra_scripts = ${common.extra_scripts}
|
||||||
|
|
Loading…
Reference in a new issue