Merge upstream changes from Marlin 2.1.2
This commit is contained in:
@@ -112,7 +112,7 @@ void GcodeSuite::M48() {
|
||||
set_bed_leveling_enabled(false);
|
||||
#endif
|
||||
|
||||
TERN_(HAS_PTC, ptc.set_enabled(!parser.seen('C') || parser.value_bool()));
|
||||
TERN_(HAS_PTC, ptc.set_enabled(parser.boolval('C', true)));
|
||||
|
||||
// Work with reasonable feedrates
|
||||
remember_feedrate_scaling_off();
|
||||
|
@@ -167,8 +167,6 @@
|
||||
if (parser.seenval('T')) draw_area_max.y = parser.value_linear_units();
|
||||
if (parser.seenval('B')) draw_area_min.y = parser.value_linear_units();
|
||||
if (parser.seenval('H')) polargraph_max_belt_len = parser.value_linear_units();
|
||||
draw_area_size.x = draw_area_max.x - draw_area_min.x;
|
||||
draw_area_size.y = draw_area_max.y - draw_area_min.y;
|
||||
}
|
||||
|
||||
void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
|
||||
|
@@ -43,13 +43,14 @@
|
||||
* S[linear] Swap length
|
||||
* B[linear] Extra Swap resume length
|
||||
* E[linear] Extra Prime length (as used by M217 Q)
|
||||
* P[linear/min] Prime speed
|
||||
* G[linear] Cutting wipe retract length (<=100mm)
|
||||
* R[linear/min] Retract speed
|
||||
* U[linear/min] UnRetract speed
|
||||
* P[linear/min] Prime speed
|
||||
* V[linear] 0/1 Enable auto prime first extruder used
|
||||
* W[linear] 0/1 Enable park & Z Raise
|
||||
* X[linear] Park X (Requires TOOLCHANGE_PARK)
|
||||
* Y[linear] Park Y (Requires TOOLCHANGE_PARK)
|
||||
* Y[linear] Park Y (Requires TOOLCHANGE_PARK and NUM_AXES >= 2)
|
||||
* I[linear] Park I (Requires TOOLCHANGE_PARK and NUM_AXES >= 4)
|
||||
* J[linear] Park J (Requires TOOLCHANGE_PARK and NUM_AXES >= 5)
|
||||
* K[linear] Park K (Requires TOOLCHANGE_PARK and NUM_AXES >= 6)
|
||||
@@ -79,6 +80,7 @@ void GcodeSuite::M217() {
|
||||
if (parser.seenval('B')) { const float v = parser.value_linear_units(); toolchange_settings.extra_resume = constrain(v, -10, 10); }
|
||||
if (parser.seenval('E')) { const float v = parser.value_linear_units(); toolchange_settings.extra_prime = constrain(v, 0, max_extrude); }
|
||||
if (parser.seenval('P')) { const int16_t v = parser.value_linear_units(); toolchange_settings.prime_speed = constrain(v, 10, 5400); }
|
||||
if (parser.seenval('G')) { const int16_t v = parser.value_linear_units(); toolchange_settings.wipe_retract = constrain(v, 0, 100); }
|
||||
if (parser.seenval('R')) { const int16_t v = parser.value_linear_units(); toolchange_settings.retract_speed = constrain(v, 10, 5400); }
|
||||
if (parser.seenval('U')) { const int16_t v = parser.value_linear_units(); toolchange_settings.unretract_speed = constrain(v, 10, 5400); }
|
||||
#if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN
|
||||
@@ -164,21 +166,24 @@ void GcodeSuite::M217_report(const bool forReplay/*=true*/) {
|
||||
SERIAL_ECHOPGM(" M217");
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
|
||||
SERIAL_ECHOPGM(" S", LINEAR_UNIT(toolchange_settings.swap_length));
|
||||
SERIAL_ECHOPGM_P(SP_B_STR, LINEAR_UNIT(toolchange_settings.extra_resume),
|
||||
SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime),
|
||||
SP_P_STR, LINEAR_UNIT(toolchange_settings.prime_speed));
|
||||
SERIAL_ECHOPGM(" R", LINEAR_UNIT(toolchange_settings.retract_speed),
|
||||
" U", LINEAR_UNIT(toolchange_settings.unretract_speed),
|
||||
" F", toolchange_settings.fan_speed,
|
||||
" D", toolchange_settings.fan_time);
|
||||
SERIAL_ECHOPGM_P(
|
||||
PSTR(" S"), LINEAR_UNIT(toolchange_settings.swap_length),
|
||||
SP_B_STR, LINEAR_UNIT(toolchange_settings.extra_resume),
|
||||
SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime),
|
||||
SP_P_STR, LINEAR_UNIT(toolchange_settings.prime_speed),
|
||||
PSTR(" G"), LINEAR_UNIT(toolchange_settings.wipe_retract),
|
||||
PSTR(" R"), LINEAR_UNIT(toolchange_settings.retract_speed),
|
||||
PSTR(" U"), LINEAR_UNIT(toolchange_settings.unretract_speed),
|
||||
PSTR(" F"), toolchange_settings.fan_speed,
|
||||
PSTR(" D"), toolchange_settings.fan_time
|
||||
);
|
||||
|
||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||
SERIAL_ECHOPGM(" A", migration.automode);
|
||||
SERIAL_ECHOPGM(" L", LINEAR_UNIT(migration.last));
|
||||
SERIAL_ECHOPGM(" A", migration.automode, " L", LINEAR_UNIT(migration.last));
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOOLCHANGE_PARK)
|
||||
{
|
||||
SERIAL_ECHOPGM(" W", LINEAR_UNIT(toolchange_settings.enable_park));
|
||||
SERIAL_ECHOPGM_P(
|
||||
SP_X_STR, LINEAR_UNIT(toolchange_settings.change_point.x)
|
||||
@@ -196,6 +201,7 @@ void GcodeSuite::M217_report(const bool forReplay/*=true*/) {
|
||||
)
|
||||
#endif
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED)
|
||||
|
@@ -57,19 +57,18 @@ void GcodeSuite::M301() {
|
||||
|
||||
if (e < HOTENDS) { // catch bad input value
|
||||
|
||||
if (parser.seenval('P')) PID_PARAM(Kp, e) = parser.value_float();
|
||||
if (parser.seenval('I')) PID_PARAM(Ki, e) = scalePID_i(parser.value_float());
|
||||
if (parser.seenval('D')) PID_PARAM(Kd, e) = scalePID_d(parser.value_float());
|
||||
if (parser.seenval('P')) SET_HOTEND_PID(Kp, e, parser.value_float());
|
||||
if (parser.seenval('I')) SET_HOTEND_PID(Ki, e, parser.value_float());
|
||||
if (parser.seenval('D')) SET_HOTEND_PID(Kd, e, parser.value_float());
|
||||
|
||||
#if ENABLED(PID_EXTRUSION_SCALING)
|
||||
if (parser.seenval('C')) PID_PARAM(Kc, e) = parser.value_float();
|
||||
if (parser.seenval('C')) SET_HOTEND_PID(Kc, e, parser.value_float());
|
||||
if (parser.seenval('L')) thermalManager.lpq_len = parser.value_int();
|
||||
NOMORE(thermalManager.lpq_len, LPQ_MAX_LEN);
|
||||
NOLESS(thermalManager.lpq_len, 0);
|
||||
LIMIT(thermalManager.lpq_len, 0, LPQ_MAX_LEN);
|
||||
#endif
|
||||
|
||||
#if ENABLED(PID_FAN_SCALING)
|
||||
if (parser.seenval('F')) PID_PARAM(Kf, e) = parser.value_float();
|
||||
if (parser.seenval('F')) SET_HOTEND_PID(Kf, e, parser.value_float());
|
||||
#endif
|
||||
|
||||
thermalManager.updatePID();
|
||||
@@ -83,6 +82,7 @@ void GcodeSuite::M301_report(const bool forReplay/*=true*/ E_OPTARG(const int8_t
|
||||
IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr int8_t eindex = -1);
|
||||
HOTEND_LOOP() {
|
||||
if (e == eindex || eindex == -1) {
|
||||
const hotend_pid_t &pid = thermalManager.temp_hotend[e].pid;
|
||||
report_echo_start(forReplay);
|
||||
SERIAL_ECHOPGM_P(
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
@@ -90,16 +90,14 @@ void GcodeSuite::M301_report(const bool forReplay/*=true*/ E_OPTARG(const int8_t
|
||||
#else
|
||||
PSTR(" M301 P")
|
||||
#endif
|
||||
, PID_PARAM(Kp, e)
|
||||
, PSTR(" I"), unscalePID_i(PID_PARAM(Ki, e))
|
||||
, PSTR(" D"), unscalePID_d(PID_PARAM(Kd, e))
|
||||
, pid.p(), PSTR(" I"), pid.i(), PSTR(" D"), pid.d()
|
||||
);
|
||||
#if ENABLED(PID_EXTRUSION_SCALING)
|
||||
SERIAL_ECHOPGM_P(SP_C_STR, PID_PARAM(Kc, e));
|
||||
SERIAL_ECHOPGM_P(SP_C_STR, pid.c());
|
||||
if (e == 0) SERIAL_ECHOPGM(" L", thermalManager.lpq_len);
|
||||
#endif
|
||||
#if ENABLED(PID_FAN_SCALING)
|
||||
SERIAL_ECHOPGM(" F", PID_PARAM(Kf, e));
|
||||
SERIAL_ECHOPGM(" F", pid.f());
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
@@ -36,17 +36,17 @@
|
||||
*/
|
||||
void GcodeSuite::M304() {
|
||||
if (!parser.seen("PID")) return M304_report();
|
||||
if (parser.seenval('P')) thermalManager.temp_bed.pid.Kp = parser.value_float();
|
||||
if (parser.seenval('I')) thermalManager.temp_bed.pid.Ki = scalePID_i(parser.value_float());
|
||||
if (parser.seenval('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float());
|
||||
if (parser.seenval('P')) thermalManager.temp_bed.pid.set_Kp(parser.value_float());
|
||||
if (parser.seenval('I')) thermalManager.temp_bed.pid.set_Ki(parser.value_float());
|
||||
if (parser.seenval('D')) thermalManager.temp_bed.pid.set_Kd(parser.value_float());
|
||||
}
|
||||
|
||||
void GcodeSuite::M304_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, F(STR_BED_PID));
|
||||
SERIAL_ECHOLNPGM(
|
||||
" M304 P", thermalManager.temp_bed.pid.Kp
|
||||
, " I", unscalePID_i(thermalManager.temp_bed.pid.Ki)
|
||||
, " D", unscalePID_d(thermalManager.temp_bed.pid.Kd)
|
||||
SERIAL_ECHOLNPGM(" M304"
|
||||
" P", thermalManager.temp_bed.pid.p()
|
||||
, " I", thermalManager.temp_bed.pid.i()
|
||||
, " D", thermalManager.temp_bed.pid.d()
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -36,17 +36,17 @@
|
||||
*/
|
||||
void GcodeSuite::M309() {
|
||||
if (!parser.seen("PID")) return M309_report();
|
||||
if (parser.seen('P')) thermalManager.temp_chamber.pid.Kp = parser.value_float();
|
||||
if (parser.seen('I')) thermalManager.temp_chamber.pid.Ki = scalePID_i(parser.value_float());
|
||||
if (parser.seen('D')) thermalManager.temp_chamber.pid.Kd = scalePID_d(parser.value_float());
|
||||
if (parser.seenval('P')) thermalManager.temp_chamber.pid.set_Kp(parser.value_float());
|
||||
if (parser.seenval('I')) thermalManager.temp_chamber.pid.set_Ki(parser.value_float());
|
||||
if (parser.seenval('D')) thermalManager.temp_chamber.pid.set_Kd(parser.value_float());
|
||||
}
|
||||
|
||||
void GcodeSuite::M309_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, F(STR_CHAMBER_PID));
|
||||
SERIAL_ECHOLNPGM(
|
||||
" M309 P", thermalManager.temp_chamber.pid.Kp
|
||||
, " I", unscalePID_i(thermalManager.temp_chamber.pid.Ki)
|
||||
, " D", unscalePID_d(thermalManager.temp_chamber.pid.Kd)
|
||||
SERIAL_ECHOLNPGM(" M309"
|
||||
" P", thermalManager.temp_chamber.pid.p()
|
||||
, " I", thermalManager.temp_chamber.pid.i()
|
||||
, " D", thermalManager.temp_chamber.pid.d()
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -313,9 +313,16 @@ void GcodeSuite::M43() {
|
||||
|
||||
// 'P' Get the range of pins to test or watch
|
||||
uint8_t first_pin = PARSED_PIN_INDEX('P', 0),
|
||||
last_pin = parser.seenval('P') ? first_pin : TERN(HAS_HIGH_ANALOG_PINS, NUM_DIGITAL_PINS, NUMBER_PINS_TOTAL) - 1;
|
||||
last_pin = parser.seenval('L') ? PARSED_PIN_INDEX('L', 0) : parser.seenval('P') ? first_pin : (NUMBER_PINS_TOTAL) - 1;
|
||||
|
||||
if (first_pin > last_pin) return;
|
||||
NOMORE(first_pin, (NUMBER_PINS_TOTAL) - 1);
|
||||
NOMORE(last_pin, (NUMBER_PINS_TOTAL) - 1);
|
||||
|
||||
if (first_pin > last_pin) {
|
||||
const uint8_t f = first_pin;
|
||||
first_pin = last_pin;
|
||||
last_pin = f;
|
||||
}
|
||||
|
||||
// 'I' to ignore protected pins
|
||||
const bool ignore_protection = parser.boolval('I');
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ALL(HAS_SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
|
||||
#if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
@@ -85,4 +85,4 @@ void GcodeSuite::M994() {
|
||||
card.closefile();
|
||||
}
|
||||
|
||||
#endif // HAS_SPI_FLASH && SDSUPPORT && MARLIN_DEV_MODE
|
||||
#endif // SPI_FLASH && SDSUPPORT && MARLIN_DEV_MODE
|
||||
|
@@ -27,8 +27,8 @@
|
||||
#include "../../gcode.h"
|
||||
#include "../../../module/planner.h"
|
||||
|
||||
#if ENABLED(EXTRA_LIN_ADVANCE_K)
|
||||
float other_extruder_advance_K[EXTRUDERS];
|
||||
#if ENABLED(ADVANCE_K_EXTRA)
|
||||
float other_extruder_advance_K[DISTINCT_E];
|
||||
uint8_t lin_adv_slot = 0;
|
||||
#endif
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
* M900: Get or Set Linear Advance K-factor
|
||||
* T<tool> Which tool to address
|
||||
* K<factor> Set current advance K factor (Slot 0).
|
||||
* L<factor> Set secondary advance K factor (Slot 1). Requires EXTRA_LIN_ADVANCE_K.
|
||||
* S<0/1> Activate slot 0 or 1. Requires EXTRA_LIN_ADVANCE_K.
|
||||
* L<factor> Set secondary advance K factor (Slot 1). Requires ADVANCE_K_EXTRA.
|
||||
* S<0/1> Activate slot 0 or 1. Requires ADVANCE_K_EXTRA.
|
||||
*/
|
||||
void GcodeSuite::M900() {
|
||||
|
||||
@@ -50,6 +50,7 @@ void GcodeSuite::M900() {
|
||||
|
||||
#if EXTRUDERS < 2
|
||||
constexpr uint8_t tool_index = 0;
|
||||
UNUSED(tool_index);
|
||||
#else
|
||||
const uint8_t tool_index = parser.intval('T', active_extruder);
|
||||
if (tool_index >= EXTRUDERS) {
|
||||
@@ -58,12 +59,12 @@ void GcodeSuite::M900() {
|
||||
}
|
||||
#endif
|
||||
|
||||
float &kref = planner.extruder_advance_K[tool_index], newK = kref;
|
||||
float &kref = planner.extruder_advance_K[E_INDEX_N(tool_index)], newK = kref;
|
||||
const float oldK = newK;
|
||||
|
||||
#if ENABLED(EXTRA_LIN_ADVANCE_K)
|
||||
#if ENABLED(ADVANCE_K_EXTRA)
|
||||
|
||||
float &lref = other_extruder_advance_K[tool_index];
|
||||
float &lref = other_extruder_advance_K[E_INDEX_N(tool_index)];
|
||||
|
||||
const bool old_slot = TEST(lin_adv_slot, tool_index), // The tool's current slot (0 or 1)
|
||||
new_slot = parser.boolval('S', old_slot); // The passed slot (default = current)
|
||||
@@ -111,9 +112,9 @@ void GcodeSuite::M900() {
|
||||
|
||||
if (!parser.seen_any()) {
|
||||
|
||||
#if ENABLED(EXTRA_LIN_ADVANCE_K)
|
||||
#if ENABLED(ADVANCE_K_EXTRA)
|
||||
|
||||
#if EXTRUDERS < 2
|
||||
#if DISTINCT_E < 2
|
||||
SERIAL_ECHOLNPGM("Advance S", new_slot, " K", kref, "(S", !new_slot, " K", lref, ")");
|
||||
#else
|
||||
EXTRUDER_LOOP() {
|
||||
@@ -127,7 +128,7 @@ void GcodeSuite::M900() {
|
||||
#else
|
||||
|
||||
SERIAL_ECHO_START();
|
||||
#if EXTRUDERS < 2
|
||||
#if DISTINCT_E < 2
|
||||
SERIAL_ECHOLNPGM("Advance K=", planner.extruder_advance_K[0]);
|
||||
#else
|
||||
SERIAL_ECHOPGM("Advance K");
|
||||
@@ -145,7 +146,7 @@ void GcodeSuite::M900() {
|
||||
|
||||
void GcodeSuite::M900_report(const bool forReplay/*=true*/) {
|
||||
report_heading(forReplay, F(STR_LINEAR_ADVANCE));
|
||||
#if EXTRUDERS < 2
|
||||
#if DISTINCT_E < 2
|
||||
report_echo_start(forReplay);
|
||||
SERIAL_ECHOLNPGM(" M900 K", planner.extruder_advance_K[0]);
|
||||
#else
|
||||
|
@@ -61,7 +61,12 @@ void GcodeSuite::M150() {
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
const pixel_index_t index = parser.intval('I', -1);
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
int8_t brightness = neo.brightness(), unit = parser.intval('S', -1);
|
||||
#ifndef NEOPIXEL_M150_DEFAULT
|
||||
#define NEOPIXEL_M150_DEFAULT -1
|
||||
#elif NEOPIXEL_M150_DEFAULT > 1
|
||||
#error "NEOPIXEL_M150_DEFAULT must be -1, 0, or 1."
|
||||
#endif
|
||||
int8_t brightness = neo.brightness(), unit = parser.intval('S', NEOPIXEL_M150_DEFAULT);
|
||||
switch (unit) {
|
||||
case -1: neo2.neoindex = index; // fall-thru
|
||||
case 0: neo.neoindex = index; old_color = parser.seen('K') ? neo.pixel_color(index >= 0 ? index : 0) : 0; break;
|
||||
|
@@ -197,8 +197,12 @@ void GcodeSuite::M569_report(const bool forReplay/*=true*/) {
|
||||
if (chop_x2 || chop_y2 || chop_z2) {
|
||||
say_M569(forReplay, F("I1"));
|
||||
if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR);
|
||||
if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
|
||||
if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
|
||||
#if HAS_Y_AXIS
|
||||
if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
|
||||
#endif
|
||||
#if HAS_Z_AXIS
|
||||
if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
|
@@ -294,14 +294,14 @@
|
||||
#if X_HAS_STEALTHCHOP || X2_HAS_STEALTHCHOP
|
||||
case X_AXIS:
|
||||
TERN_(X_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(X,X));
|
||||
TERN_(X2_HAS_STEALTHCHOP, if (!(index & 1)) TMC_SET_PWMTHRS(X,X2));
|
||||
TERN_(X2_HAS_STEALTHCHOP, if (!index || index == 2) TMC_SET_PWMTHRS(X,X2));
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if Y_HAS_STEALTHCHOP || Y2_HAS_STEALTHCHOP
|
||||
case Y_AXIS:
|
||||
TERN_(Y_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(Y,Y));
|
||||
TERN_(Y2_HAS_STEALTHCHOP, if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2));
|
||||
TERN_(Y2_HAS_STEALTHCHOP, if (!index || index == 2) TMC_SET_PWMTHRS(Y,Y2));
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -499,7 +499,6 @@
|
||||
* M914: Set StallGuard sensitivity.
|
||||
*/
|
||||
void GcodeSuite::M914() {
|
||||
|
||||
bool report = true;
|
||||
const uint8_t index = parser.byteval('I');
|
||||
LOOP_NUM_AXES(i) if (parser.seen(AXIS_CHAR(i))) {
|
||||
@@ -509,13 +508,13 @@
|
||||
#if X_SENSORLESS
|
||||
case X_AXIS:
|
||||
if (index < 2) stepperX.homing_threshold(value);
|
||||
TERN_(X2_SENSORLESS, if (!(index & 1)) stepperX2.homing_threshold(value));
|
||||
TERN_(X2_SENSORLESS, if (!index || index == 2) stepperX2.homing_threshold(value));
|
||||
break;
|
||||
#endif
|
||||
#if Y_SENSORLESS
|
||||
case Y_AXIS:
|
||||
if (index < 2) stepperY.homing_threshold(value);
|
||||
TERN_(Y2_SENSORLESS, if (!(index & 1)) stepperY2.homing_threshold(value));
|
||||
TERN_(Y2_SENSORLESS, if (!index || index == 2) stepperY2.homing_threshold(value));
|
||||
break;
|
||||
#endif
|
||||
#if Z_SENSORLESS
|
||||
|
@@ -561,8 +561,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 48: M48(); break; // M48: Z probe repeatability test
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
case 73: M73(); break; // M73: Set progress percentage (for display on LCD)
|
||||
#if ENABLED(SET_PROGRESS_MANUALLY)
|
||||
case 73: M73(); break; // M73: Set progress percentage
|
||||
#endif
|
||||
|
||||
case 75: M75(); break; // M75: Start print timer
|
||||
@@ -600,7 +600,9 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
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.
|
||||
TERN_(HOST_PROMPT_SUPPORT, case 876:) // M876: Handle Host prompt responses
|
||||
#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:)
|
||||
@@ -793,6 +795,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 250: M250(); break; // M250: Set LCD contrast
|
||||
#endif
|
||||
|
||||
#if HAS_GCODE_M255
|
||||
case 255: M255(); break; // M255: Set LCD Sleep/Backlight Timeout (Minutes)
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
case 256: M256(); break; // M256: Set LCD brightness
|
||||
#endif
|
||||
@@ -927,6 +933,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 575: M575(); break; // M575: Set serial baudrate
|
||||
#endif
|
||||
|
||||
#if HAS_SHAPING
|
||||
case 593: M593(); break; // M593: Set Input Shaping parameters
|
||||
#endif
|
||||
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
case 600: M600(); break; // M600: Pause for Filament Change
|
||||
case 603: M603(); break; // M603: Configure Filament Change
|
||||
@@ -1047,7 +1057,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe
|
||||
#endif
|
||||
|
||||
#if ALL(HAS_SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
|
||||
#if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
|
||||
case 993: M993(); break; // M993: Backup SPI Flash to SD
|
||||
case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash
|
||||
#endif
|
||||
|
@@ -114,7 +114,7 @@
|
||||
* M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins (Requires PINS_DEBUGGING)
|
||||
* M48 - Measure Z Probe repeatability: M48 P<points> X<pos> Y<pos> V<level> E<engage> L<legs> S<chizoid>. (Requires Z_MIN_PROBE_REPEATABILITY_TEST)
|
||||
*
|
||||
* M73 - Set the progress percentage. (Requires LCD_SET_PROGRESS_MANUALLY)
|
||||
* M73 - Set the progress percentage. (Requires SET_PROGRESS_MANUALLY)
|
||||
* M75 - Start the print job timer.
|
||||
* M76 - Pause the print job timer.
|
||||
* M77 - Stop the print job timer.
|
||||
@@ -259,6 +259,7 @@
|
||||
* M554 - Get or set IP gateway. (Requires enabled Ethernet port)
|
||||
* M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160)
|
||||
* M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE)
|
||||
* M593 - Get or set input shaping parameters. (Requires INPUT_SHAPING_[XY])
|
||||
* M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
|
||||
* M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
|
||||
* M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
|
||||
@@ -677,7 +678,7 @@ private:
|
||||
static void M48();
|
||||
#endif
|
||||
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#if ENABLED(SET_PROGRESS_MANUALLY)
|
||||
static void M73();
|
||||
#endif
|
||||
|
||||
@@ -1080,6 +1081,11 @@ private:
|
||||
static void M575();
|
||||
#endif
|
||||
|
||||
#if HAS_SHAPING
|
||||
static void M593();
|
||||
static void M593_report(const bool forReplay=true);
|
||||
#endif
|
||||
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
static void M600();
|
||||
static void M603();
|
||||
@@ -1194,7 +1200,7 @@ private:
|
||||
static void M995();
|
||||
#endif
|
||||
|
||||
#if BOTH(HAS_SPI_FLASH, SDSUPPORT)
|
||||
#if BOTH(SPI_FLASH, SDSUPPORT)
|
||||
static void M993();
|
||||
static void M994();
|
||||
#endif
|
||||
|
@@ -32,6 +32,10 @@
|
||||
#include "../../feature/caselight.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_STM32_UID) && !defined(MACHINE_UUID)
|
||||
#include "../../libs/hex_print.h"
|
||||
#endif
|
||||
|
||||
//#define MINIMAL_CAP_LINES // Don't even mention the disabled capabilities
|
||||
|
||||
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
|
||||
@@ -59,20 +63,37 @@
|
||||
* the capability is not present.
|
||||
*/
|
||||
void GcodeSuite::M115() {
|
||||
SERIAL_ECHOLNPGM(
|
||||
"FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ") "
|
||||
"SOURCE_CODE_URL:" SOURCE_CODE_URL " "
|
||||
"PROTOCOL_VERSION:" PROTOCOL_VERSION " "
|
||||
"MACHINE_TYPE:" MACHINE_NAME " "
|
||||
"EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " "
|
||||
SERIAL_ECHOPGM("FIRMWARE_NAME:Marlin"
|
||||
" " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ")"
|
||||
" SOURCE_CODE_URL:" SOURCE_CODE_URL
|
||||
" PROTOCOL_VERSION:" PROTOCOL_VERSION
|
||||
" MACHINE_TYPE:" MACHINE_NAME
|
||||
" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)
|
||||
#if NUM_AXES != XYZ
|
||||
"AXIS_COUNT:" STRINGIFY(NUM_AXES) " "
|
||||
" AXIS_COUNT:" STRINGIFY(NUM_AXES)
|
||||
#endif
|
||||
#ifdef MACHINE_UUID
|
||||
"UUID:" MACHINE_UUID
|
||||
" UUID:" MACHINE_UUID
|
||||
#endif
|
||||
);
|
||||
|
||||
// STM32UID:111122223333
|
||||
#if ENABLED(HAS_STM32_UID) && !defined(MACHINE_UUID)
|
||||
// STM32 based devices output the CPU device serial number
|
||||
// Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations
|
||||
// https://github.com/opulo-inc/lumenpnp
|
||||
// Although this code should work on all STM32 based boards
|
||||
SERIAL_ECHOPGM(" UUID:");
|
||||
uint32_t *uid_address = (uint32_t*)UID_BASE;
|
||||
LOOP_L_N(i, 3) {
|
||||
const uint32_t UID = uint32_t(READ_REG(*(uid_address)));
|
||||
uid_address += 4U;
|
||||
for (int B = 24; B >= 0; B -= 8) print_hex_byte(UID >> B);
|
||||
}
|
||||
#endif
|
||||
|
||||
SERIAL_EOL();
|
||||
|
||||
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
|
||||
|
||||
// The port that sent M115
|
||||
@@ -121,7 +142,7 @@ void GcodeSuite::M115() {
|
||||
cap_line(F("LEVELING_DATA"), ENABLED(HAS_LEVELING));
|
||||
|
||||
// BUILD_PERCENT (M73)
|
||||
cap_line(F("BUILD_PERCENT"), ENABLED(LCD_SET_PROGRESS_MANUALLY));
|
||||
cap_line(F("BUILD_PERCENT"), ENABLED(SET_PROGRESS_PERCENT));
|
||||
|
||||
// SOFTWARE_POWER (M80, M81)
|
||||
cap_line(F("SOFTWARE_POWER"), ENABLED(PSU_CONTROL));
|
||||
@@ -130,6 +151,13 @@ void GcodeSuite::M115() {
|
||||
cap_line(F("TOGGLE_LIGHTS"), ENABLED(CASE_LIGHT_ENABLE));
|
||||
cap_line(F("CASE_LIGHT_BRIGHTNESS"), TERN0(CASE_LIGHT_ENABLE, caselight.has_brightness()));
|
||||
|
||||
// SPINDLE AND LASER CONTROL (M3, M4, M5)
|
||||
#if ENABLED(SPINDLE_FEATURE)
|
||||
cap_line(F("SPINDLE"), true);
|
||||
#elif ENABLED(LASER_FEATURE)
|
||||
cap_line(F("LASER"), true);
|
||||
#endif
|
||||
|
||||
// EMERGENCY_PARSER (M108, M112, M410, M876)
|
||||
cap_line(F("EMERGENCY_PARSER"), ENABLED(EMERGENCY_PARSER));
|
||||
|
||||
@@ -194,26 +222,49 @@ void GcodeSuite::M115() {
|
||||
|
||||
// Machine Geometry
|
||||
#if ENABLED(M115_GEOMETRY_REPORT)
|
||||
const xyz_pos_t bmin = { 0, 0, 0 },
|
||||
bmax = { X_BED_SIZE , Y_BED_SIZE, Z_MAX_POS },
|
||||
dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
|
||||
dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
|
||||
constexpr xyz_pos_t bmin{0},
|
||||
bmax = ARRAY_N(NUM_AXES, X_BED_SIZE, Y_BED_SIZE, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS, U_MAX_POS, V_MAX_POS, W_MAX_POS),
|
||||
dmin = ARRAY_N(NUM_AXES, X_MIN_POS, Y_MIN_POS, Z_MIN_POS, I_MIN_POS, J_MIN_POS, K_MIN_POS, U_MIN_POS, V_MIN_POS, W_MIN_POS),
|
||||
dmax = ARRAY_N(NUM_AXES, X_MAX_POS, Y_MAX_POS, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS, U_MAX_POS, V_MAX_POS, W_MAX_POS);
|
||||
xyz_pos_t cmin = bmin, cmax = bmax;
|
||||
apply_motion_limits(cmin);
|
||||
apply_motion_limits(cmax);
|
||||
const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
|
||||
wmin = cmin.asLogical(), wmax = cmax.asLogical();
|
||||
|
||||
SERIAL_ECHOLNPGM(
|
||||
"area:{"
|
||||
"full:{"
|
||||
"min:{x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z, "},"
|
||||
"max:{x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z, "}"
|
||||
"},"
|
||||
"min:{"
|
||||
LIST_N(DOUBLE(NUM_AXES),
|
||||
"x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z,
|
||||
",i:", lmin.i, ",j:", lmin.j, ",k:", lmin.k,
|
||||
",u:", lmin.u, ",v:", lmin.v, ",w:", lmin.w
|
||||
),
|
||||
"},max:{"
|
||||
LIST_N(DOUBLE(NUM_AXES),
|
||||
"x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z,
|
||||
",i:", lmax.i, ",j:", lmax.j, ",k:", lmax.k,
|
||||
",u:", lmax.u, ",v:", lmax.v, ",w:", lmax.w
|
||||
),
|
||||
"}" // max
|
||||
"}," // full
|
||||
"work:{"
|
||||
"min:{x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z, "},"
|
||||
"max:{x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z, "}",
|
||||
"}"
|
||||
"}"
|
||||
"min:{"
|
||||
LIST_N(DOUBLE(NUM_AXES),
|
||||
"x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z,
|
||||
",i:", wmin.i, ",j:", wmin.j, ",k:", wmin.k,
|
||||
",u:", wmin.u, ",v:", wmin.v, ",w:", wmin.w
|
||||
),
|
||||
"},max:{"
|
||||
LIST_N(DOUBLE(NUM_AXES),
|
||||
"x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z,
|
||||
",i:", wmax.i, ",j:", wmax.j, ",k:", wmax.k,
|
||||
",u:", wmax.u, ",v:", wmax.v, ",w:", wmax.w
|
||||
),
|
||||
"}" // max
|
||||
"}" // work
|
||||
"}" // area
|
||||
);
|
||||
#endif
|
||||
|
||||
|
@@ -85,7 +85,12 @@ void GcodeSuite::M0_M1() {
|
||||
|
||||
#endif
|
||||
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR)));
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
if (parser.string_arg)
|
||||
hostui.prompt_do(PROMPT_USER_CONTINUE, parser.string_arg, FPSTR(CONTINUE_STR));
|
||||
else
|
||||
hostui.prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR));
|
||||
#endif
|
||||
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
|
||||
|
||||
|
@@ -32,12 +32,11 @@
|
||||
*/
|
||||
void GcodeSuite::M255() {
|
||||
if (parser.seenval('S')) {
|
||||
const int m = parser.value_int();
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
const int m = parser.value_int();
|
||||
ui.sleep_timeout_minutes = constrain(m, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX);
|
||||
ui.sleep_timeout_minutes = constrain(m, ui.sleep_timeout_min, ui.sleep_timeout_max);
|
||||
#else
|
||||
const unsigned int s = parser.value_ushort() * 60;
|
||||
ui.lcd_backlight_timeout = constrain(s, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX);
|
||||
ui.backlight_timeout_minutes = constrain(m, ui.backlight_timeout_min, ui.backlight_timeout_max);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -47,11 +46,8 @@ void GcodeSuite::M255() {
|
||||
void GcodeSuite::M255_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, F(STR_DISPLAY_SLEEP));
|
||||
SERIAL_ECHOLNPGM(" M255 S",
|
||||
#if HAS_DISPLAY_SLEEP
|
||||
ui.sleep_timeout_minutes, " ; (minutes)"
|
||||
#else
|
||||
ui.lcd_backlight_timeout, " ; (seconds)"
|
||||
#endif
|
||||
TERN(HAS_DISPLAY_SLEEP, ui.sleep_timeout_minutes, ui.backlight_timeout_minutes),
|
||||
" ; (minutes)"
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -22,11 +22,12 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
#if ENABLED(SET_PROGRESS_MANUALLY)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
#include "../../libs/numtostr.h"
|
||||
|
||||
#if ENABLED(DWIN_LCD_PROUI)
|
||||
#include "../../lcd/e3v2/proui/dwin.h"
|
||||
@@ -36,7 +37,15 @@
|
||||
* M73: Set percentage complete (for display on LCD)
|
||||
*
|
||||
* Example:
|
||||
* M73 P25 ; Set progress to 25%
|
||||
* M73 P25.63 ; Set progress to 25.63%
|
||||
* M73 R456 ; Set remaining time to 456 minutes
|
||||
* M73 C12 ; Set next interaction countdown to 12 minutes
|
||||
* M73 ; Report current values
|
||||
*
|
||||
* M73 Progress: ---%; Time left: -----m; Change: -----m;
|
||||
*
|
||||
* When PRINT_PROGRESS_SHOW_DECIMALS is enabled - reports percent with 100% / 23.4% / 3.45% format
|
||||
*
|
||||
*/
|
||||
void GcodeSuite::M73() {
|
||||
|
||||
@@ -46,17 +55,40 @@ void GcodeSuite::M73() {
|
||||
|
||||
#else
|
||||
|
||||
if (parser.seenval('P'))
|
||||
ui.set_progress((PROGRESS_SCALE) > 1
|
||||
? parser.value_float() * (PROGRESS_SCALE)
|
||||
: parser.value_byte()
|
||||
);
|
||||
#if ENABLED(SET_PROGRESS_PERCENT)
|
||||
if (parser.seenval('P'))
|
||||
ui.set_progress((PROGRESS_SCALE) > 1
|
||||
? parser.value_float() * (PROGRESS_SCALE)
|
||||
: parser.value_byte()
|
||||
);
|
||||
#endif
|
||||
|
||||
#if ENABLED(USE_M73_REMAINING_TIME)
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
if (parser.seenval('R')) ui.set_remaining_time(60 * parser.value_ulong());
|
||||
#endif
|
||||
|
||||
#if ENABLED(SET_INTERACTION_TIME)
|
||||
if (parser.seenval('C')) ui.set_interaction_time(60 * parser.value_ulong());
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(M73_REPORT)
|
||||
if (TERN1(M73_REPORT_SD_ONLY, IS_SD_PRINTING())) {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM(" M73");
|
||||
#if ENABLED(SET_PROGRESS_PERCENT)
|
||||
SERIAL_ECHOPGM(" Progress: ", TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui.get_progress_percent()), "%;");
|
||||
#endif
|
||||
#if ENABLED(SET_REMAINING_TIME)
|
||||
SERIAL_ECHOPGM(" Time left: ", ui.remaining_time / 60, "m;");
|
||||
#endif
|
||||
#if ENABLED(SET_INTERACTION_TIME)
|
||||
SERIAL_ECHOPGM(" Change: ", ui.interaction_time / 60, "m;");
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // LCD_SET_PROGRESS_MANUALLY
|
||||
#endif // SET_PROGRESS_MANUALLY
|
||||
|
@@ -256,22 +256,20 @@ public:
|
||||
|
||||
// Float removes 'E' to prevent scientific notation interpretation
|
||||
static float value_float() {
|
||||
if (value_ptr) {
|
||||
char *e = value_ptr;
|
||||
for (;;) {
|
||||
const char c = *e;
|
||||
if (c == '\0' || c == ' ') break;
|
||||
if (c == 'E' || c == 'e') {
|
||||
*e = '\0';
|
||||
const float ret = strtof(value_ptr, nullptr);
|
||||
*e = c;
|
||||
return ret;
|
||||
}
|
||||
++e;
|
||||
if (!value_ptr) return 0;
|
||||
char *e = value_ptr;
|
||||
for (;;) {
|
||||
const char c = *e;
|
||||
if (c == '\0' || c == ' ') break;
|
||||
if (c == 'E' || c == 'e' || c == 'X' || c == 'x') {
|
||||
*e = '\0';
|
||||
const float ret = strtof(value_ptr, nullptr);
|
||||
*e = c;
|
||||
return ret;
|
||||
}
|
||||
return strtof(value_ptr, nullptr);
|
||||
++e;
|
||||
}
|
||||
return 0;
|
||||
return strtof(value_ptr, nullptr);
|
||||
}
|
||||
|
||||
// Code value as a long or ulong
|
||||
|
@@ -58,16 +58,13 @@ void GcodeSuite::G30() {
|
||||
tool_change(0);
|
||||
#endif
|
||||
|
||||
const xy_pos_t pos = { parser.linearval('X', current_position.x + probe.offset_xy.x),
|
||||
parser.linearval('Y', current_position.y + probe.offset_xy.y) };
|
||||
// Convert the given logical position to native position
|
||||
const xy_pos_t pos = {
|
||||
parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x,
|
||||
parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y
|
||||
};
|
||||
|
||||
if (!probe.can_reach(pos)) {
|
||||
#if ENABLED(DWIN_LCD_PROUI)
|
||||
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
|
||||
LCD_MESSAGE(MSG_ZPROBE_OUT);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
if (probe.can_reach(pos)) {
|
||||
// Disable leveling so the planner won't mess with us
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
|
||||
|
||||
@@ -83,7 +80,7 @@ void GcodeSuite::G30() {
|
||||
const float measured_z = probe.probe_at_point(pos, raise_after, 1);
|
||||
TERN_(HAS_PTC, ptc.set_enabled(true));
|
||||
if (!isnan(measured_z)) {
|
||||
SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z);
|
||||
SERIAL_ECHOLNPGM("Bed X: ", pos.asLogical().x, " Y: ", pos.asLogical().y, " Z: ", measured_z);
|
||||
#if EITHER(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
|
||||
char msg[31], str_1[6], str_2[6], str_3[6];
|
||||
sprintf_P(msg, PSTR("X:%s, Y:%s, Z:%s"),
|
||||
@@ -102,6 +99,12 @@ void GcodeSuite::G30() {
|
||||
|
||||
report_current_position();
|
||||
}
|
||||
else {
|
||||
#if ENABLED(DWIN_LCD_PROUI)
|
||||
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
|
||||
LCD_MESSAGE(MSG_ZPROBE_OUT);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Restore the active tool
|
||||
TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index));
|
||||
|
@@ -469,8 +469,11 @@ void GCodeQueue::get_serial_commands() {
|
||||
|
||||
const long gcode_N = strtol(npos + 1, nullptr, 10);
|
||||
|
||||
// The line number must be in the correct sequence.
|
||||
if (gcode_N != serial.last_N + 1 && !M110) {
|
||||
// In case of error on a serial port, don't prevent other serial port from making progress
|
||||
// A request-for-resend line was already in transit so we got two - oops!
|
||||
if (WITHIN(gcode_N, serial.last_N - 1, serial.last_N)) continue;
|
||||
// A corrupted line or too high, indicating a lost line
|
||||
gcode_line_error(F(STR_ERR_LINE_NO), p);
|
||||
break;
|
||||
}
|
||||
@@ -480,13 +483,11 @@ void GCodeQueue::get_serial_commands() {
|
||||
uint8_t checksum = 0, count = uint8_t(apos - command);
|
||||
while (count) checksum ^= command[--count];
|
||||
if (strtol(apos + 1, nullptr, 10) != checksum) {
|
||||
// In case of error on a serial port, don't prevent other serial port from making progress
|
||||
gcode_line_error(F(STR_ERR_CHECKSUM_MISMATCH), p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// In case of error on a serial port, don't prevent other serial port from making progress
|
||||
gcode_line_error(F(STR_ERR_NO_CHECKSUM), p);
|
||||
break;
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include "../queue.h"
|
||||
#endif
|
||||
|
||||
#if EITHER(LCD_SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE)
|
||||
#if EITHER(SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE)
|
||||
#include "../../lcd/marlinui.h"
|
||||
#endif
|
||||
|
||||
@@ -84,7 +84,7 @@ void GcodeSuite::M1001() {
|
||||
process_subcommands_now(F("M77"));
|
||||
|
||||
// Set the progress bar "done" state
|
||||
TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress_done());
|
||||
TERN_(SET_PROGRESS_PERCENT, ui.set_progress_done());
|
||||
|
||||
// Announce SD file completion
|
||||
{
|
||||
|
@@ -28,18 +28,23 @@
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M20: List SD card to serial output
|
||||
* M20: List SD card to serial output in [name] [size] format.
|
||||
*
|
||||
* With CUSTOM_FIRMWARE_UPLOAD:
|
||||
* F<bool> - List BIN files only, for use with firmware upload
|
||||
*
|
||||
* With LONG_FILENAME_HOST_SUPPORT:
|
||||
* L<bool> - List long filenames (instead of DOS8.3 names)
|
||||
*
|
||||
* With M20_TIMESTAMP_SUPPORT:
|
||||
* T<bool> - Include timestamps
|
||||
*/
|
||||
void GcodeSuite::M20() {
|
||||
if (card.flag.mounted) {
|
||||
SERIAL_ECHOLNPGM(STR_BEGIN_FILE_LIST);
|
||||
card.ls(
|
||||
TERN_(CUSTOM_FIRMWARE_UPLOAD, parser.boolval('F'))
|
||||
#if BOTH(CUSTOM_FIRMWARE_UPLOAD, LONG_FILENAME_HOST_SUPPORT)
|
||||
,
|
||||
#endif
|
||||
TERN_(LONG_FILENAME_HOST_SUPPORT, parser.boolval('L'))
|
||||
);
|
||||
card.ls(TERN0(CUSTOM_FIRMWARE_UPLOAD, parser.boolval('F') << LS_ONLY_BIN)
|
||||
| TERN0(LONG_FILENAME_HOST_SUPPORT, parser.boolval('L') << LS_LONG_FILENAME)
|
||||
| TERN0(M20_TIMESTAMP_SUPPORT, parser.boolval('T') << LS_TIMESTAMP));
|
||||
SERIAL_ECHOLNPGM(STR_END_FILE_LIST);
|
||||
}
|
||||
else
|
||||
|
@@ -38,7 +38,7 @@ void GcodeSuite::M23() {
|
||||
for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
|
||||
card.openFileRead(parser.string_arg);
|
||||
|
||||
TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(0));
|
||||
TERN_(SET_PROGRESS_PERCENT, ui.set_progress(0));
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#if ENABLED(MPCTEMP)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
#include "../../module/temperature.h"
|
||||
|
||||
/**
|
||||
@@ -42,7 +43,12 @@
|
||||
*/
|
||||
|
||||
void GcodeSuite::M306() {
|
||||
if (parser.seen_test('T')) { thermalManager.MPC_autotune(); return; }
|
||||
if (parser.seen_test('T')) {
|
||||
LCD_MESSAGE(MSG_MPC_AUTOTUNE);
|
||||
thermalManager.MPC_autotune();
|
||||
ui.reset_status();
|
||||
return;
|
||||
}
|
||||
|
||||
if (parser.seen("ACFPRH")) {
|
||||
const heater_id_t hid = (heater_id_t)parser.intval('E', 0);
|
||||
|
Reference in New Issue
Block a user