Merge upstream changes from Marlin 2.1.2.1
This commit is contained in:
@@ -162,8 +162,8 @@ float g26_random_deviation = 0.0;
|
||||
*/
|
||||
bool user_canceled() {
|
||||
if (!ui.button_pressed()) return false; // Return if the button isn't pressed
|
||||
ui.set_status(GET_TEXT_F(MSG_G26_CANCELED), 99);
|
||||
TERN_(HAS_MARLINUI_MENU, ui.quick_feedback());
|
||||
LCD_MESSAGE_MAX(MSG_G26_CANCELED);
|
||||
ui.quick_feedback();
|
||||
ui.wait_for_release();
|
||||
return true;
|
||||
}
|
||||
@@ -321,11 +321,9 @@ typedef struct {
|
||||
#if HAS_HEATED_BED
|
||||
|
||||
if (bed_temp > 25) {
|
||||
#if HAS_WIRED_LCD
|
||||
ui.set_status(GET_TEXT_F(MSG_G26_HEATING_BED), 99);
|
||||
ui.quick_feedback();
|
||||
TERN_(HAS_MARLINUI_MENU, ui.capture());
|
||||
#endif
|
||||
LCD_MESSAGE_MAX(MSG_G26_HEATING_BED);
|
||||
ui.quick_feedback();
|
||||
TERN_(HAS_MARLINUI_MENU, ui.capture());
|
||||
thermalManager.setTargetBed(bed_temp);
|
||||
|
||||
// Wait for the temperature to stabilize
|
||||
@@ -340,20 +338,16 @@ typedef struct {
|
||||
#endif // HAS_HEATED_BED
|
||||
|
||||
// Start heating the active nozzle
|
||||
#if HAS_WIRED_LCD
|
||||
ui.set_status(GET_TEXT_F(MSG_G26_HEATING_NOZZLE), 99);
|
||||
ui.quick_feedback();
|
||||
#endif
|
||||
LCD_MESSAGE_MAX(MSG_G26_HEATING_NOZZLE);
|
||||
ui.quick_feedback();
|
||||
thermalManager.setTargetHotend(hotend_temp, active_extruder);
|
||||
|
||||
// Wait for the temperature to stabilize
|
||||
if (!thermalManager.wait_for_hotend(active_extruder, true OPTARG(G26_CLICK_CAN_CANCEL, true)))
|
||||
return G26_ERR;
|
||||
|
||||
#if HAS_WIRED_LCD
|
||||
ui.reset_status();
|
||||
ui.quick_feedback();
|
||||
#endif
|
||||
ui.reset_status();
|
||||
ui.completion_feedback();
|
||||
|
||||
return G26_OK;
|
||||
}
|
||||
@@ -371,7 +365,7 @@ typedef struct {
|
||||
|
||||
if (prime_flag == -1) { // The user wants to control how much filament gets purged
|
||||
ui.capture();
|
||||
ui.set_status(GET_TEXT_F(MSG_G26_MANUAL_PRIME), 99);
|
||||
LCD_MESSAGE_MAX(MSG_G26_MANUAL_PRIME);
|
||||
ui.chirp();
|
||||
|
||||
destination = current_position;
|
||||
@@ -398,17 +392,15 @@ typedef struct {
|
||||
|
||||
ui.wait_for_release();
|
||||
|
||||
ui.set_status(GET_TEXT_F(MSG_G26_PRIME_DONE), 99);
|
||||
LCD_MESSAGE_MAX(MSG_G26_PRIME_DONE);
|
||||
ui.quick_feedback();
|
||||
ui.release();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#if HAS_WIRED_LCD
|
||||
ui.set_status(GET_TEXT_F(MSG_G26_FIXED_LENGTH), 99);
|
||||
ui.quick_feedback();
|
||||
#endif
|
||||
LCD_MESSAGE_MAX(MSG_G26_FIXED_LENGTH);
|
||||
ui.quick_feedback();
|
||||
destination = current_position;
|
||||
destination.e += prime_length;
|
||||
prepare_internal_move_to_destination(fr_slow_e);
|
||||
@@ -853,7 +845,7 @@ void GcodeSuite::G26() {
|
||||
} while (--g26_repeats && location.valid());
|
||||
|
||||
LEAVE:
|
||||
ui.set_status(GET_TEXT_F(MSG_G26_LEAVING), -1);
|
||||
LCD_MESSAGE_MIN(MSG_G26_LEAVING);
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(location, ExtUI::G26_FINISH));
|
||||
|
||||
g26.retract_filament(destination);
|
||||
|
@@ -409,7 +409,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
if (!probe.good_bounds(abl.probe_position_lf, abl.probe_position_rb)) {
|
||||
if (DEBUGGING(LEVELING)) {
|
||||
DEBUG_ECHOLNPGM("G29 L", abl.probe_position_lf.x, " R", abl.probe_position_rb.x,
|
||||
" F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y);
|
||||
" F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y);
|
||||
}
|
||||
SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds.");
|
||||
G29_RETURN(false, false);
|
||||
@@ -417,7 +417,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
|
||||
// Probe at the points of a lattice grid
|
||||
abl.gridSpacing.set((abl.probe_position_rb.x - abl.probe_position_lf.x) / (abl.grid_points.x - 1),
|
||||
(abl.probe_position_rb.y - abl.probe_position_lf.y) / (abl.grid_points.y - 1));
|
||||
(abl.probe_position_rb.y - abl.probe_position_lf.y) / (abl.grid_points.y - 1));
|
||||
|
||||
#endif // ABL_USES_GRID
|
||||
|
||||
@@ -453,9 +453,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
}
|
||||
|
||||
// Position bed horizontally and Z probe vertically.
|
||||
#if defined(SAFE_BED_LEVELING_START_X) || defined(SAFE_BED_LEVELING_START_Y) || defined(SAFE_BED_LEVELING_START_Z) \
|
||||
|| defined(SAFE_BED_LEVELING_START_I) || defined(SAFE_BED_LEVELING_START_J) || defined(SAFE_BED_LEVELING_START_K) \
|
||||
|| defined(SAFE_BED_LEVELING_START_U) || defined(SAFE_BED_LEVELING_START_V) || defined(SAFE_BED_LEVELING_START_W)
|
||||
#if HAS_SAFE_BED_LEVELING
|
||||
xyze_pos_t safe_position = current_position;
|
||||
#ifdef SAFE_BED_LEVELING_START_X
|
||||
safe_position.x = SAFE_BED_LEVELING_START_X;
|
||||
@@ -486,7 +484,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
#endif
|
||||
|
||||
do_blocking_move_to(safe_position);
|
||||
#endif
|
||||
#endif // HAS_SAFE_BED_LEVELING
|
||||
|
||||
// Disable auto bed leveling during G29.
|
||||
// Be formal so G29 can be done successively without G28.
|
||||
|
@@ -108,9 +108,7 @@ void GcodeSuite::G29() {
|
||||
TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());
|
||||
|
||||
// Position bed horizontally and Z probe vertically.
|
||||
#if defined(SAFE_BED_LEVELING_START_X) || defined(SAFE_BED_LEVELING_START_Y) || defined(SAFE_BED_LEVELING_START_Z) \
|
||||
|| defined(SAFE_BED_LEVELING_START_I) || defined(SAFE_BED_LEVELING_START_J) || defined(SAFE_BED_LEVELING_START_K) \
|
||||
|| defined(SAFE_BED_LEVELING_START_U) || defined(SAFE_BED_LEVELING_START_V) || defined(SAFE_BED_LEVELING_START_W)
|
||||
#if HAS_SAFE_BED_LEVELING
|
||||
xyze_pos_t safe_position = current_position;
|
||||
#ifdef SAFE_BED_LEVELING_START_X
|
||||
safe_position.x = SAFE_BED_LEVELING_START_X;
|
||||
@@ -141,7 +139,7 @@ void GcodeSuite::G29() {
|
||||
#endif
|
||||
|
||||
do_blocking_move_to(safe_position);
|
||||
#endif
|
||||
#endif // HAS_SAFE_BED_LEVELING
|
||||
|
||||
return;
|
||||
}
|
||||
|
@@ -403,26 +403,54 @@ void GcodeSuite::G28() {
|
||||
UNUSED(needZ); UNUSED(homeZZ);
|
||||
#else
|
||||
constexpr bool doZ = false;
|
||||
#if !HAS_Y_AXIS
|
||||
constexpr bool doY = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Z may home first, e.g., when homing away from the bed
|
||||
TERN_(HOME_Z_FIRST, if (doZ) homeaxis(Z_AXIS));
|
||||
|
||||
// 'R' to specify a specific raise. 'R0' indicates no raise, e.g., for recovery.resume
|
||||
// When 'R0' is used, there should already be adequate clearance, e.g., from homing Z to max.
|
||||
const bool seenR = parser.seenval('R');
|
||||
const float z_homing_height = seenR ? parser.value_linear_units() : Z_HOMING_HEIGHT;
|
||||
|
||||
if (z_homing_height && (seenR || NUM_AXIS_GANG(doX, || doY, || TERN0(Z_SAFE_HOMING, doZ), || doI, || doJ, || doK, || doU, || doV, || doW))) {
|
||||
// Raise Z before homing any other axes and z is not already high enough (never lower z)
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Raise Z (before homing) by ", z_homing_height);
|
||||
do_z_clearance(z_homing_height);
|
||||
TERN_(BLTOUCH, bltouch.init());
|
||||
// Use raise given by 'R' or Z_HOMING_HEIGHT (above the probe trigger point)
|
||||
float z_homing_height = seenR ? parser.value_linear_units() : Z_HOMING_HEIGHT;
|
||||
|
||||
// Check for any lateral motion that might require clearance
|
||||
const bool may_skate = seenR || NUM_AXIS_GANG(doX, || doY, || TERN0(Z_SAFE_HOMING, doZ), || doI, || doJ, || doK, || doU, || doV, || doW);
|
||||
|
||||
if (seenR && z_homing_height == 0) {
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("R0 = No Z raise");
|
||||
}
|
||||
else {
|
||||
bool with_probe = ENABLED(HOMING_Z_WITH_PROBE);
|
||||
// Raise above the current Z (which should be synced in the planner)
|
||||
// The "height" for Z is a coordinate. But if Z is not trusted/homed make it relative.
|
||||
if (seenR || !TERN(HOME_AFTER_DEACTIVATE, axis_is_trusted, axis_was_homed)(Z_AXIS)) {
|
||||
z_homing_height += current_position.z;
|
||||
with_probe = false;
|
||||
}
|
||||
|
||||
if (may_skate) {
|
||||
// Apply Z clearance before doing any lateral motion
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Raise Z before homing:");
|
||||
do_z_clearance(z_homing_height, with_probe);
|
||||
}
|
||||
}
|
||||
|
||||
// Init BLTouch ahead of any lateral motion, even if not homing with the probe
|
||||
TERN_(BLTOUCH, if (may_skate) bltouch.init());
|
||||
|
||||
// Diagonal move first if both are homing
|
||||
TERN_(QUICK_HOME, if (doX && doY) quick_home_xy());
|
||||
|
||||
// Home Y (before X)
|
||||
if (ENABLED(HOME_Y_BEFORE_X) && (doY || TERN0(CODEPENDENT_XY_HOMING, doX)))
|
||||
homeaxis(Y_AXIS);
|
||||
#if HAS_Y_AXIS
|
||||
// Home Y (before X)
|
||||
if (ENABLED(HOME_Y_BEFORE_X) && (doY || TERN0(CODEPENDENT_XY_HOMING, doX)))
|
||||
homeaxis(Y_AXIS);
|
||||
#endif
|
||||
|
||||
// Home X
|
||||
if (doX || (doY && ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X))) {
|
||||
@@ -455,9 +483,11 @@ void GcodeSuite::G28() {
|
||||
if (doI) homeaxis(I_AXIS);
|
||||
#endif
|
||||
|
||||
// Home Y (after X)
|
||||
if (DISABLED(HOME_Y_BEFORE_X) && doY)
|
||||
homeaxis(Y_AXIS);
|
||||
#if HAS_Y_AXIS
|
||||
// Home Y (after X)
|
||||
if (DISABLED(HOME_Y_BEFORE_X) && doY)
|
||||
homeaxis(Y_AXIS);
|
||||
#endif
|
||||
|
||||
#if BOTH(FOAMCUTTER_XYUV, HAS_J_AXIS)
|
||||
// Home J (after Y)
|
||||
|
@@ -58,7 +58,7 @@ void GcodeSuite::G34() {
|
||||
// Move XY to safe position
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Parking XY");
|
||||
const xy_pos_t safe_pos = GANTRY_CALIBRATION_SAFE_POSITION;
|
||||
do_blocking_move_to(safe_pos, MMM_TO_MMS(GANTRY_CALIBRATION_XY_PARK_FEEDRATE));
|
||||
do_blocking_move_to_xy(safe_pos, MMM_TO_MMS(GANTRY_CALIBRATION_XY_PARK_FEEDRATE));
|
||||
#endif
|
||||
|
||||
const float move_distance = parser.intval('Z', GANTRY_CALIBRATION_EXTRA_HEIGHT),
|
||||
|
@@ -84,7 +84,7 @@ void GcodeSuite::M48() {
|
||||
};
|
||||
|
||||
if (!probe.can_reach(test_position)) {
|
||||
ui.set_status(GET_TEXT_F(MSG_M48_OUT_OF_BOUNDS), 99);
|
||||
LCD_MESSAGE_MAX(MSG_M48_OUT_OF_BOUNDS);
|
||||
SERIAL_ECHOLNPGM("? (X,Y) out of bounds.");
|
||||
return;
|
||||
}
|
||||
|
@@ -221,9 +221,9 @@ void GcodeSuite::M203_report(const bool forReplay/*=true*/) {
|
||||
/**
|
||||
* M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000)
|
||||
*
|
||||
* P = Printing moves
|
||||
* R = Retract only (no X, Y, Z) moves
|
||||
* T = Travel (non printing) moves
|
||||
* P<accel> Printing moves
|
||||
* R<accel> Retract only (no X, Y, Z) moves
|
||||
* T<accel> Travel (non printing) moves
|
||||
*/
|
||||
void GcodeSuite::M204() {
|
||||
if (!parser.seen("PRST"))
|
||||
@@ -247,24 +247,37 @@ void GcodeSuite::M204_report(const bool forReplay/*=true*/) {
|
||||
);
|
||||
}
|
||||
|
||||
#if AXIS_COLLISION('B')
|
||||
#define M205_MIN_SEG_TIME_PARAM 'D'
|
||||
#define M205_MIN_SEG_TIME_STR "D"
|
||||
#warning "Use 'M205 D' for Minimum Segment Time."
|
||||
#else
|
||||
#define M205_MIN_SEG_TIME_PARAM 'B'
|
||||
#define M205_MIN_SEG_TIME_STR "B"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M205: Set Advanced Settings
|
||||
*
|
||||
* B = Min Segment Time (µs)
|
||||
* S = Min Feed Rate (units/s)
|
||||
* T = Min Travel Feed Rate (units/s)
|
||||
* X = Max X Jerk (units/sec^2)
|
||||
* Y = Max Y Jerk (units/sec^2)
|
||||
* Z = Max Z Jerk (units/sec^2)
|
||||
* E = Max E Jerk (units/sec^2)
|
||||
* J = Junction Deviation (mm) (If not using CLASSIC_JERK)
|
||||
* B<µs> : Min Segment Time
|
||||
* S<units/s> : Min Feed Rate
|
||||
* T<units/s> : Min Travel Feed Rate
|
||||
*
|
||||
* With CLASSIC_JERK:
|
||||
* X<units/sec^2> : Max X Jerk
|
||||
* Y<units/sec^2> : Max Y Jerk
|
||||
* Z<units/sec^2> : Max Z Jerk
|
||||
* ... : etc
|
||||
* E<units/sec^2> : Max E Jerk
|
||||
*
|
||||
* Without CLASSIC_JERK:
|
||||
* J(mm) : Junction Deviation
|
||||
*/
|
||||
void GcodeSuite::M205() {
|
||||
if (!parser.seen("BST" TERN_(HAS_JUNCTION_DEVIATION, "J") TERN_(HAS_CLASSIC_JERK, "XYZE")))
|
||||
return M205_report();
|
||||
if (!parser.seen_any()) return M205_report();
|
||||
|
||||
//planner.synchronize();
|
||||
if (parser.seenval('B')) planner.settings.min_segment_time_us = parser.value_ulong();
|
||||
if (parser.seenval(M205_MIN_SEG_TIME_PARAM)) planner.settings.min_segment_time_us = parser.value_ulong();
|
||||
if (parser.seenval('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units();
|
||||
if (parser.seenval('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units();
|
||||
#if HAS_JUNCTION_DEVIATION
|
||||
@@ -304,7 +317,7 @@ void GcodeSuite::M205() {
|
||||
|
||||
void GcodeSuite::M205_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, F(
|
||||
"Advanced (B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
|
||||
"Advanced (" M205_MIN_SEG_TIME_STR "<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
|
||||
TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>")
|
||||
#if HAS_CLASSIC_JERK
|
||||
NUM_AXIS_GANG(
|
||||
@@ -317,7 +330,7 @@ void GcodeSuite::M205_report(const bool forReplay/*=true*/) {
|
||||
")"
|
||||
));
|
||||
SERIAL_ECHOLNPGM_P(
|
||||
PSTR(" M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us)
|
||||
PSTR(" M205 " M205_MIN_SEG_TIME_STR), LINEAR_UNIT(planner.settings.min_segment_time_us)
|
||||
, PSTR(" S"), LINEAR_UNIT(planner.settings.min_feedrate_mm_s)
|
||||
, SP_T_STR, LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s)
|
||||
#if HAS_JUNCTION_DEVIATION
|
||||
|
@@ -36,16 +36,15 @@
|
||||
* R : Flag to restore the last-saved factor
|
||||
*/
|
||||
void GcodeSuite::M220() {
|
||||
if (!parser.seen_any()) {
|
||||
SERIAL_ECHOLNPGM("FR:", feedrate_percentage, "%");
|
||||
return;
|
||||
}
|
||||
|
||||
static int16_t backup_feedrate_percentage = 100;
|
||||
if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage;
|
||||
if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage;
|
||||
|
||||
const int16_t now_feedrate_perc = feedrate_percentage;
|
||||
if (parser.seen_test('R')) feedrate_percentage = backup_feedrate_percentage;
|
||||
if (parser.seen_test('B')) backup_feedrate_percentage = now_feedrate_perc;
|
||||
if (parser.seenval('S')) feedrate_percentage = parser.value_int();
|
||||
|
||||
if (!parser.seen_any()) {
|
||||
SERIAL_ECHOPGM("FR:", feedrate_percentage);
|
||||
SERIAL_CHAR('%');
|
||||
SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "../../module/temperature.h"
|
||||
|
||||
#if ENABLED(DWIN_LCD_PROUI)
|
||||
#include "../../lcd/e3v2/proui/dwin_defines.h"
|
||||
#include "../../lcd/e3v2/proui/dwin.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@@ -313,7 +313,7 @@ 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('L') ? PARSED_PIN_INDEX('L', 0) : parser.seenval('P') ? first_pin : (NUMBER_PINS_TOTAL) - 1;
|
||||
last_pin = parser.seenval('L') ? PARSED_PIN_INDEX('L', 0) : (parser.seenval('P') ? first_pin : (NUMBER_PINS_TOTAL) - 1);
|
||||
|
||||
NOMORE(first_pin, (NUMBER_PINS_TOTAL) - 1);
|
||||
NOMORE(last_pin, (NUMBER_PINS_TOTAL) - 1);
|
||||
@@ -329,15 +329,18 @@ void GcodeSuite::M43() {
|
||||
|
||||
// 'W' Watch until click, M108, or reset
|
||||
if (parser.boolval('W')) {
|
||||
SERIAL_ECHOLNPGM("Watching pins");
|
||||
#ifdef ARDUINO_ARCH_SAM
|
||||
NOLESS(first_pin, 2); // Don't hijack the UART pins
|
||||
#endif
|
||||
uint8_t pin_state[last_pin - first_pin + 1];
|
||||
|
||||
const uint8_t pin_count = last_pin - first_pin + 1;
|
||||
uint8_t pin_state[pin_count];
|
||||
bool can_watch = false;
|
||||
LOOP_S_LE_N(i, first_pin, last_pin) {
|
||||
pin_t pin = GET_PIN_MAP_PIN_M43(i);
|
||||
if (!VALID_PIN(pin)) continue;
|
||||
if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) continue;
|
||||
can_watch = true;
|
||||
pinMode(pin, INPUT_PULLUP);
|
||||
delay(1);
|
||||
/*
|
||||
@@ -348,16 +351,36 @@ void GcodeSuite::M43() {
|
||||
pin_state[i - first_pin] = extDigitalRead(pin);
|
||||
}
|
||||
|
||||
const bool multipin = (pin_count > 1);
|
||||
|
||||
if (!can_watch) {
|
||||
SERIAL_ECHOPGM("Specified pin");
|
||||
SERIAL_ECHOPGM_P(multipin ? PSTR("s are") : PSTR(" is"));
|
||||
SERIAL_ECHOLNPGM(" protected. Use 'I' to override.");
|
||||
return;
|
||||
}
|
||||
|
||||
// "Watching pin(s) # - #"
|
||||
SERIAL_ECHOPGM("Watching pin");
|
||||
if (multipin) SERIAL_CHAR('s');
|
||||
SERIAL_CHAR(' '); SERIAL_ECHO(first_pin);
|
||||
if (multipin) SERIAL_ECHOPGM(" - ", last_pin);
|
||||
SERIAL_EOL();
|
||||
|
||||
#if HAS_RESUME_CONTINUE
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
wait_for_user = true;
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("M43 Wait Called"), FPSTR(CONTINUE_STR)));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("M43 Wait Called")));
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(F("M43 Waiting...")));
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired(F("M43 Waiting..."));
|
||||
#else
|
||||
LCD_MESSAGE(MSG_USERWAIT);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
for (;;) {
|
||||
LOOP_S_LE_N(i, first_pin, last_pin) {
|
||||
pin_t pin = GET_PIN_MAP_PIN_M43(i);
|
||||
const pin_t pin = GET_PIN_MAP_PIN_M43(i);
|
||||
if (!VALID_PIN(pin)) continue;
|
||||
if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) continue;
|
||||
const byte val =
|
||||
@@ -368,7 +391,7 @@ void GcodeSuite::M43() {
|
||||
//*/
|
||||
extDigitalRead(pin);
|
||||
if (val != pin_state[i - first_pin]) {
|
||||
report_pin_state_extended(pin, ignore_protection, false);
|
||||
report_pin_state_extended(pin, ignore_protection, true);
|
||||
pin_state[i - first_pin] = val;
|
||||
}
|
||||
}
|
||||
@@ -380,11 +403,13 @@ void GcodeSuite::M43() {
|
||||
|
||||
safe_delay(200);
|
||||
}
|
||||
|
||||
TERN_(HAS_RESUME_CONTINUE, ui.reset_status());
|
||||
}
|
||||
else {
|
||||
// Report current state of selected pin(s)
|
||||
LOOP_S_LE_N(i, first_pin, last_pin) {
|
||||
pin_t pin = GET_PIN_MAP_PIN_M43(i);
|
||||
const pin_t pin = GET_PIN_MAP_PIN_M43(i);
|
||||
if (VALID_PIN(pin)) report_pin_state_extended(pin, ignore_protection, true);
|
||||
}
|
||||
}
|
||||
|
@@ -29,9 +29,6 @@
|
||||
|
||||
#if NUM_AXES == XYZ && EXTRUDERS >= 1
|
||||
#define HAS_M350_B_PARAM 1 // "5th axis" (after E0) for an original XYZEB setup.
|
||||
#if AXIS_COLLISION('B')
|
||||
#error "M350 parameter 'B' collision with axis name."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@@ -169,7 +169,7 @@
|
||||
if (parser.seen("EPS")) {
|
||||
planner.synchronize();
|
||||
if (parser.seenval('P')) duplication_e_mask = parser.value_int(); // Set the mask directly
|
||||
else if (parser.seenval('E')) duplication_e_mask = pow(2, parser.value_int() + 1) - 1; // Set the mask by E index
|
||||
else if (parser.seenval('E')) duplication_e_mask = _BV(parser.value_int() + 1) - 1; // Set the mask by E index
|
||||
ena = (2 == parser.intval('S', extruder_duplication_enabled ? 2 : 0));
|
||||
set_duplication_enabled(ena && (duplication_e_mask >= 3));
|
||||
}
|
||||
|
0
Marlin/src/gcode/control/M80_M81.cpp
Executable file → Normal file
0
Marlin/src/gcode/control/M80_M81.cpp
Executable file → Normal file
@@ -26,7 +26,7 @@
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(CONFIGURATION_EMBEDDING)
|
||||
#include "../../sd/SdBaseFile.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
#include "../../mczip.h"
|
||||
#endif
|
||||
|
||||
@@ -66,11 +66,19 @@ void GcodeSuite::M502() {
|
||||
|
||||
#if ENABLED(CONFIGURATION_EMBEDDING)
|
||||
if (parser.seen_test('C')) {
|
||||
SdBaseFile file;
|
||||
const uint16_t size = sizeof(mc_zip);
|
||||
MediaFile file;
|
||||
// Need to create the config size on the SD card
|
||||
if (file.open("mc.zip", O_WRITE|O_CREAT) && file.write(pgm_read_ptr(mc_zip), size) != -1 && file.close())
|
||||
SERIAL_ECHO_MSG("Configuration saved as 'mc.zip'");
|
||||
MediaFile root = card.getroot();
|
||||
if (file.open(&root, "mc.zip", O_WRITE|O_CREAT)) {
|
||||
bool success = true;
|
||||
for (uint16_t i = 0; success && i < sizeof(mc_zip); ++i) {
|
||||
const uint8_t c = pgm_read_byte(&mc_zip[i]);
|
||||
success = (file.write(c) == 1);
|
||||
}
|
||||
success = file.close() && success;
|
||||
|
||||
if (success) SERIAL_ECHO_MSG("Configuration saved as 'mc.zip'");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -128,11 +128,13 @@ void GcodeSuite::M240() {
|
||||
|
||||
if (homing_needed_error()) return;
|
||||
|
||||
const xyz_pos_t old_pos = {
|
||||
const xyz_pos_t old_pos = NUM_AXIS_ARRAY(
|
||||
current_position.x + parser.linearval('A'),
|
||||
current_position.y + parser.linearval('B'),
|
||||
current_position.z
|
||||
};
|
||||
current_position.z,
|
||||
current_position.i, current_position.j, current_position.k,
|
||||
current_position.u, current_position.v, current_position.w
|
||||
);
|
||||
|
||||
#ifdef PHOTO_RETRACT_MM
|
||||
const float rval = parser.linearval('R', _PHOTO_RETRACT_MM);
|
||||
@@ -140,7 +142,7 @@ void GcodeSuite::M240() {
|
||||
e_move_m240(-rval, sval);
|
||||
#endif
|
||||
|
||||
feedRate_t fr_mm_s = MMM_TO_MMS(parser.linearval('F'));
|
||||
feedRate_t fr_mm_s = parser.feedrateval('F');
|
||||
if (fr_mm_s) NOLESS(fr_mm_s, 10.0f);
|
||||
|
||||
constexpr xyz_pos_t photo_position = PHOTO_POSITION;
|
||||
|
@@ -49,8 +49,8 @@ void GcodeSuite::M593_report(const bool forReplay/*=true*/) {
|
||||
* D<factor> Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes.
|
||||
* F<frequency> Set the frequency. If axes (X, Y, etc.) are not specified, set for all axes.
|
||||
* T[map] Input Shaping type, 0:ZV, 1:EI, 2:2H EI (not implemented yet)
|
||||
* X<1> Set the given parameters only for the X axis.
|
||||
* Y<1> Set the given parameters only for the Y axis.
|
||||
* X Set the given parameters only for the X axis.
|
||||
* Y Set the given parameters only for the Y axis.
|
||||
*/
|
||||
void GcodeSuite::M593() {
|
||||
if (!parser.seen_any()) return M593_report();
|
||||
|
@@ -35,11 +35,24 @@
|
||||
/**
|
||||
* G61: Return to saved position
|
||||
*
|
||||
* F<rate> - Feedrate (optional) for the move back.
|
||||
* S<slot> - Slot # (0-based) to restore from (default 0).
|
||||
* X Y Z E - Axes to restore. At least one is required.
|
||||
* F<rate> - Feedrate (optional) for the move back.
|
||||
* S<slot> - Slot # (0-based) to restore from (default 0).
|
||||
* X<offset> - Restore X axis, applying the given offset (default 0)
|
||||
* Y<offset> - Restore Y axis, applying the given offset (default 0)
|
||||
* Z<offset> - Restore Z axis, applying the given offset (default 0)
|
||||
*
|
||||
* If XYZE are not given, default restore uses the smart blocking move.
|
||||
* If there is an Extruder:
|
||||
* E<offset> - Restore E axis, applying the given offset (default 0)
|
||||
*
|
||||
* With extra axes using default names:
|
||||
* A<offset> - Restore 4th axis, applying the given offset (default 0)
|
||||
* B<offset> - Restore 5th axis, applying the given offset (default 0)
|
||||
* C<offset> - Restore 6th axis, applying the given offset (default 0)
|
||||
* U<offset> - Restore 7th axis, applying the given offset (default 0)
|
||||
* V<offset> - Restore 8th axis, applying the given offset (default 0)
|
||||
* W<offset> - Restore 9th axis, applying the given offset (default 0)
|
||||
*
|
||||
* If no axes are specified then all axes are restored.
|
||||
*/
|
||||
void GcodeSuite::G61() {
|
||||
|
||||
@@ -71,7 +84,7 @@ void GcodeSuite::G61() {
|
||||
if (parser.seen(STR_AXES_MAIN)) {
|
||||
DEBUG_ECHOPGM(STR_RESTORING_POS " S", slot);
|
||||
LOOP_NUM_AXES(i) {
|
||||
destination[i] = parser.seenval(AXIS_CHAR(i))
|
||||
destination[i] = parser.seen(AXIS_CHAR(i))
|
||||
? stored_position[slot][i] + parser.value_axis_units((AxisEnum)i)
|
||||
: current_position[i];
|
||||
DEBUG_CHAR(' ', AXIS_CHAR(i));
|
||||
|
0
Marlin/src/gcode/feature/pause/M600.cpp
Executable file → Normal file
0
Marlin/src/gcode/feature/pause/M600.cpp
Executable file → Normal file
@@ -47,7 +47,7 @@ void GcodeSuite::M122() {
|
||||
if (sflag && !sval)
|
||||
tmc_set_report_interval(0);
|
||||
else if (parser.seenval('P'))
|
||||
tmc_set_report_interval(_MAX(250, parser.value_ushort()));
|
||||
tmc_set_report_interval(_MAX(uint16_t(250), parser.value_ushort()));
|
||||
else if (sval)
|
||||
tmc_set_report_interval(MONITOR_DRIVER_STATUS_INTERVAL_MS);
|
||||
#endif
|
||||
|
@@ -53,6 +53,8 @@ static void set_stealth_status(const bool enable, const int8_t eindex) {
|
||||
constexpr int8_t index = -1;
|
||||
#endif
|
||||
|
||||
UNUSED(index);
|
||||
|
||||
LOOP_LOGICAL_AXES(i) if (parser.seen(AXIS_CHAR(i))) {
|
||||
switch (i) {
|
||||
case X_AXIS:
|
||||
|
@@ -156,20 +156,21 @@ void GcodeSuite::D(const int16_t dcode) {
|
||||
} break;
|
||||
|
||||
case 5: { // D5 Read / Write onboard Flash
|
||||
#define FLASH_SIZE 1024
|
||||
// This will overwrite program and data, so don't use it.
|
||||
#define ONBOARD_FLASH_SIZE 1024 // 0x400
|
||||
uint8_t *pointer = parser.hex_adr_val('A');
|
||||
uint16_t len = parser.ushortval('C', 1);
|
||||
uintptr_t addr = (uintptr_t)pointer;
|
||||
NOMORE(addr, size_t(FLASH_SIZE - 1));
|
||||
NOMORE(len, FLASH_SIZE - addr);
|
||||
NOMORE(addr, size_t(ONBOARD_FLASH_SIZE - 1));
|
||||
NOMORE(len, ONBOARD_FLASH_SIZE - addr);
|
||||
if (parser.seenval('X')) {
|
||||
// TODO: Write the hex bytes after the X
|
||||
//while (len--) {}
|
||||
}
|
||||
else {
|
||||
//while (len--) {
|
||||
//// TODO: Read bytes from EEPROM
|
||||
// print_hex_byte(eeprom_read_byte(adr++));
|
||||
//// TODO: Read bytes from FLASH
|
||||
// print_hex_byte(flash_read_byte(adr++));
|
||||
//}
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
@@ -223,9 +223,9 @@ void GcodeSuite::M115() {
|
||||
// Machine Geometry
|
||||
#if ENABLED(M115_GEOMETRY_REPORT)
|
||||
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);
|
||||
bmax = NUM_AXIS_ARRAY(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 = NUM_AXIS_ARRAY(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 = NUM_AXIS_ARRAY(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);
|
||||
|
@@ -87,9 +87,9 @@ void GcodeSuite::M0_M1() {
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
if (parser.string_arg)
|
||||
hostui.prompt_do(PROMPT_USER_CONTINUE, parser.string_arg, FPSTR(CONTINUE_STR));
|
||||
hostui.continue_prompt(parser.string_arg);
|
||||
else
|
||||
hostui.prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? F("M1 Stop") : F("M0 Stop"), FPSTR(CONTINUE_STR));
|
||||
hostui.continue_prompt(parser.codenum ? F("M1 Stop") : F("M0 Stop"));
|
||||
#endif
|
||||
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));
|
||||
|
@@ -47,7 +47,7 @@ void GcodeSuite::M145() {
|
||||
preheat_t &mat = ui.material_preset[material];
|
||||
#if HAS_HOTEND
|
||||
if (parser.seenval('H'))
|
||||
mat.hotend_temp = constrain(parser.value_int(), EXTRUDE_MINTEMP, thermalManager.hotend_max_target(0));
|
||||
mat.hotend_temp = constrain(parser.value_int(), thermalManager.extrude_min_temp, thermalManager.hotend_max_target(0));
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
if (parser.seenval('B'))
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "../../module/motion.h"
|
||||
#include "../../module/probe.h"
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
|
||||
#if HAS_PTC
|
||||
#include "../../feature/probe_temp_comp.h"
|
||||
@@ -37,10 +38,6 @@
|
||||
#include "../../module/tool_change.h"
|
||||
#endif
|
||||
|
||||
#if EITHER(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
|
||||
#include "../../lcd/marlinui.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* G30: Do a single Z probe at the current XY
|
||||
*
|
||||
@@ -70,9 +67,7 @@ void GcodeSuite::G30() {
|
||||
|
||||
remember_feedrate_scaling_off();
|
||||
|
||||
#if EITHER(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
|
||||
process_subcommands_now(F("G28O"));
|
||||
#endif
|
||||
TERN_(DWIN_CREALITY_LCD_JYERSUI, process_subcommands_now(F("G28O")));
|
||||
|
||||
const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
|
||||
|
||||
@@ -100,10 +95,8 @@ 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
|
||||
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
|
||||
LCD_MESSAGE(MSG_ZPROBE_OUT);
|
||||
}
|
||||
|
||||
// Restore the active tool
|
||||
|
@@ -110,13 +110,7 @@ void GcodeSuite::G38(const int8_t subcode) {
|
||||
|
||||
remember_feedrate_scaling_off();
|
||||
|
||||
const bool error_on_fail =
|
||||
#if ENABLED(G38_PROBE_AWAY)
|
||||
!TEST(subcode, 0)
|
||||
#else
|
||||
(subcode == 2)
|
||||
#endif
|
||||
;
|
||||
const bool error_on_fail = TERN(G38_PROBE_AWAY, !TEST(subcode, 0), subcode == 2);
|
||||
|
||||
// If any axis has enough movement, do the move
|
||||
LOOP_NUM_AXES(i)
|
||||
|
0
Marlin/src/gcode/queue.cpp
Executable file → Normal file
0
Marlin/src/gcode/queue.cpp
Executable file → Normal file
@@ -97,7 +97,7 @@ void GcodeSuite::M1001() {
|
||||
if (long_print) {
|
||||
printerEventLEDs.onPrintCompleted();
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_PRINT_DONE)));
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_PRINT_DONE), FPSTR(CONTINUE_STR)));
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(GET_TEXT_F(MSG_PRINT_DONE)));
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(SEC_TO_MS(TERN(HAS_MARLINUI_MENU, PE_LEDS_COMPLETED_TIME, 30))));
|
||||
printerEventLEDs.onResumeAfterWait();
|
||||
}
|
||||
@@ -109,7 +109,6 @@ void GcodeSuite::M1001() {
|
||||
#endif
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onPrintDone());
|
||||
TERN_(DWIN_LCD_PROUI, DWIN_Print_Finished());
|
||||
|
||||
// Re-select the last printed file in the UI
|
||||
TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file());
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
#if ENABLED(DWIN_LCD_PROUI)
|
||||
#include "../../lcd/e3v2/proui/dwin.h"
|
||||
#include "../../lcd/marlinui.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -38,7 +38,7 @@ void GcodeSuite::M524() {
|
||||
|
||||
#if ENABLED(DWIN_LCD_PROUI)
|
||||
|
||||
HMI_flag.abort_flag = true; // The LCD will handle it
|
||||
ui.abort_print();
|
||||
|
||||
#else
|
||||
|
||||
|
@@ -39,7 +39,6 @@
|
||||
void GcodeSuite::M75() {
|
||||
startOrResumeJob();
|
||||
#if ENABLED(DWIN_LCD_PROUI)
|
||||
DWIN_Print_Started(false);
|
||||
if (!IS_SD_PRINTING()) DWIN_Print_Header(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT));
|
||||
#endif
|
||||
}
|
||||
@@ -48,9 +47,8 @@ void GcodeSuite::M75() {
|
||||
* M76: Pause print timer
|
||||
*/
|
||||
void GcodeSuite::M76() {
|
||||
print_job_timer.pause();
|
||||
TERN(DWIN_LCD_PROUI, ui.pause_print(), print_job_timer.pause());
|
||||
TERN_(HOST_PAUSE_M76, hostui.pause());
|
||||
TERN_(DWIN_LCD_PROUI, DWIN_Print_Pause());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +56,6 @@ void GcodeSuite::M76() {
|
||||
*/
|
||||
void GcodeSuite::M77() {
|
||||
print_job_timer.stop();
|
||||
TERN_(DWIN_LCD_PROUI, DWIN_Print_Finished());
|
||||
}
|
||||
|
||||
#if ENABLED(PRINTCOUNTER)
|
||||
|
@@ -61,15 +61,9 @@ void GcodeSuite::M303() {
|
||||
const heater_id_t hid = (heater_id_t)parser.intval('E');
|
||||
celsius_t default_temp;
|
||||
switch (hid) {
|
||||
#if ENABLED(PIDTEMP)
|
||||
case 0 ... HOTENDS - 1: default_temp = PREHEAT_1_TEMP_HOTEND; break;
|
||||
#endif
|
||||
#if ENABLED(PIDTEMPBED)
|
||||
case H_BED: default_temp = PREHEAT_1_TEMP_BED; break;
|
||||
#endif
|
||||
#if ENABLED(PIDTEMPCHAMBER)
|
||||
case H_CHAMBER: default_temp = PREHEAT_1_TEMP_CHAMBER; break;
|
||||
#endif
|
||||
OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: default_temp = PREHEAT_1_TEMP_HOTEND; break)
|
||||
OPTCODE(PIDTEMPBED, case H_BED: default_temp = PREHEAT_1_TEMP_BED; break)
|
||||
OPTCODE(PIDTEMPCHAMBER, case H_CHAMBER: default_temp = PREHEAT_1_TEMP_CHAMBER; break)
|
||||
default:
|
||||
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
|
||||
SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID);
|
||||
@@ -84,9 +78,15 @@ void GcodeSuite::M303() {
|
||||
const celsius_t temp = seenS ? parser.value_celsius() : default_temp;
|
||||
const bool u = parser.boolval('U');
|
||||
|
||||
#if ENABLED(DWIN_LCD_PROUI)
|
||||
#if ENABLED(DWIN_LCD_PROUI) && EITHER(PIDTEMP, PIDTEMPBED)
|
||||
if (seenC) HMI_data.PidCycles = c;
|
||||
if (seenS) { if (hid == H_BED) HMI_data.BedPidT = temp; else HMI_data.HotendPidT = temp; }
|
||||
if (seenS) {
|
||||
switch (hid) {
|
||||
OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: HMI_data.HotendPidT = temp; break)
|
||||
OPTCODE(PIDTEMPBED, case H_BED: HMI_data.BedPidT = temp; break)
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if DISABLED(BUSY_WHILE_HEATING)
|
||||
|
Reference in New Issue
Block a user