Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x

This commit is contained in:
Bob-the-Kuhn
2019-04-12 22:07:12 -05:00
365 changed files with 15127 additions and 4499 deletions

View File

@ -246,8 +246,6 @@ void move_to(const float &rx, const float &ry, const float &z, const float &e_de
// Yes: a 'normal' movement. No: a retract() or recover()
feed_value = has_xy_component ? G26_XY_FEEDRATE : planner.settings.max_feedrate_mm_s[E_AXIS] / 1.5;
if (g26_debug_flag) SERIAL_ECHOLNPAIR("in move_to() feed_value for XY:", feed_value);
destination[X_AXIS] = rx;
destination[Y_AXIS] = ry;
destination[E_AXIS] += e_delta;
@ -327,19 +325,15 @@ inline bool look_for_lines_to_connect() {
for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) {
#if HAS_LCD_MENU
if (user_canceled()) return true; // Check if the user wants to stop the Mesh Validation
if (user_canceled()) return true;
#endif
if (i < GRID_MAX_POINTS_X) { // We can't connect to anything to the right than GRID_MAX_POINTS_X.
// This is already a half circle because we are at the edge of the bed.
if (i < GRID_MAX_POINTS_X) { // Can't connect to anything to the right than GRID_MAX_POINTS_X.
// Already a half circle at the edge of the bed.
if (is_bitmap_set(circle_flags, i, j) && is_bitmap_set(circle_flags, i + 1, j)) { // check if we can do a line to the left
if (!is_bitmap_set(horizontal_mesh_line_flags, i, j)) {
//
// We found two circles that need a horizontal line to connect them
// Print it!
//
// Two circles need a horizontal line to connect them
sx = _GET_MESH_X( i ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // right edge
ex = _GET_MESH_X(i + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // left edge
@ -347,27 +341,19 @@ inline bool look_for_lines_to_connect() {
sy = ey = constrain(_GET_MESH_Y(j), Y_MIN_POS + 1, Y_MAX_POS - 1);
ex = constrain(ex, X_MIN_POS + 1, X_MAX_POS - 1);
if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey)) {
if (g26_debug_flag) {
SERIAL_ECHOLNPAIR(" Connecting with horizontal line (sx=", sx, ", sy=", sy, ") -> (ex=", ex, ", ey=", ey, ")");
//debug_current_and_destination(PSTR("Connecting horizontal line."));
}
if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey))
print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height);
}
bitmap_set(horizontal_mesh_line_flags, i, j); // Mark it as done so we don't do it again, even if we skipped it
bitmap_set(horizontal_mesh_line_flags, i, j); // Mark done, even if skipped
}
}
if (j < GRID_MAX_POINTS_Y) { // We can't connect to anything further back than GRID_MAX_POINTS_Y.
// This is already a half circle because we are at the edge of the bed.
if (j < GRID_MAX_POINTS_Y) { // Can't connect to anything further back than GRID_MAX_POINTS_Y.
// Already a half circle at the edge of the bed.
if (is_bitmap_set(circle_flags, i, j) && is_bitmap_set(circle_flags, i, j + 1)) { // check if we can do a line straight down
if (!is_bitmap_set( vertical_mesh_line_flags, i, j)) {
//
// We found two circles that need a vertical line to connect them
// Print it!
//
// Two circles that need a vertical line to connect them
sy = _GET_MESH_Y( j ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // top edge
ey = _GET_MESH_Y(j + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // bottom edge
@ -375,23 +361,10 @@ inline bool look_for_lines_to_connect() {
sy = constrain(sy, Y_MIN_POS + 1, Y_MAX_POS - 1);
ey = constrain(ey, Y_MIN_POS + 1, Y_MAX_POS - 1);
if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey)) {
if (g26_debug_flag) {
SERIAL_ECHOPAIR(" Connecting with vertical line (sx=", sx);
SERIAL_ECHOPAIR(", sy=", sy);
SERIAL_ECHOPAIR(") -> (ex=", ex);
SERIAL_ECHOPAIR(", ey=", ey);
SERIAL_CHAR(')');
SERIAL_EOL();
#if ENABLED(AUTO_BED_LEVELING_UBL)
debug_current_and_destination(PSTR("Connecting vertical line."));
#endif
}
if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey))
print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height);
}
bitmap_set(vertical_mesh_line_flags, i, j); // Mark it as done so we don't do it again, even if skipped
bitmap_set(vertical_mesh_line_flags, i, j); // Mark done, even if skipped
}
}
}
@ -725,8 +698,6 @@ void GcodeSuite::G26() {
ui.capture();
#endif
//debug_current_and_destination(PSTR("Starting G26 Mesh Validation Pattern."));
#if DISABLED(ARC_SUPPORT)
/**
@ -768,6 +739,7 @@ void GcodeSuite::G26() {
#if ENABLED(ARC_SUPPORT)
#define ARC_LENGTH(quarters) (INTERSECTION_CIRCLE_RADIUS * M_PI * (quarters) / 2)
#define INTERSECTION_CIRCLE_DIAM ((INTERSECTION_CIRCLE_RADIUS) * 2)
float sx = circle_x + INTERSECTION_CIRCLE_RADIUS, // default to full circle
ex = circle_x + INTERSECTION_CIRCLE_RADIUS,
sy = circle_y, ey = circle_y,
@ -775,14 +747,8 @@ void GcodeSuite::G26() {
// Figure out where to start and end the arc - we always print counterclockwise
if (xi == 0) { // left edge
if (!f) {
sx = circle_x;
sy -= (INTERSECTION_CIRCLE_RADIUS);
}
if (!b) {
ex = circle_x;
ey += INTERSECTION_CIRCLE_RADIUS;
}
if (!f) { sx = circle_x; sy -= INTERSECTION_CIRCLE_RADIUS; }
if (!b) { ex = circle_x; ey += INTERSECTION_CIRCLE_RADIUS; }
arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2);
}
else if (r) { // right edge
@ -793,26 +759,23 @@ void GcodeSuite::G26() {
arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2);
}
else if (f) {
ex = circle_x - (INTERSECTION_CIRCLE_RADIUS);
ex -= INTERSECTION_CIRCLE_DIAM;
arc_length = ARC_LENGTH(2);
}
else if (b) {
sx = circle_x - (INTERSECTION_CIRCLE_RADIUS);
sx -= INTERSECTION_CIRCLE_DIAM;
arc_length = ARC_LENGTH(2);
}
const float arc_offset[2] = {
circle_x - sx,
circle_y - sy
};
const float dx_s = current_position[X_AXIS] - sx, // find our distance from the start of the actual circle
const float arc_offset[2] = { circle_x - sx, circle_y - sy },
dx_s = current_position[X_AXIS] - sx, // find our distance from the start of the actual circle
dy_s = current_position[Y_AXIS] - sy,
dist_start = HYPOT2(dx_s, dy_s);
const float endpoint[XYZE] = {
ex, ey,
g26_layer_height,
current_position[E_AXIS] + (arc_length * g26_e_axis_feedrate * g26_extrusion_multiplier)
};
dist_start = HYPOT2(dx_s, dy_s),
endpoint[XYZE] = {
ex, ey,
g26_layer_height,
current_position[E_AXIS] + (arc_length * g26_e_axis_feedrate * g26_extrusion_multiplier)
};
if (dist_start > 2.0) {
retract_filament(destination);
@ -827,18 +790,6 @@ void GcodeSuite::G26() {
const float save_feedrate = feedrate_mm_s;
feedrate_mm_s = PLANNER_XY_FEEDRATE() / 10.0;
if (g26_debug_flag) {
SERIAL_ECHOPAIR(" plan_arc(ex=", endpoint[X_AXIS]);
SERIAL_ECHOPAIR(", ey=", endpoint[Y_AXIS]);
SERIAL_ECHOPAIR(", ez=", endpoint[Z_AXIS]);
SERIAL_ECHOPAIR(", len=", arc_length);
SERIAL_ECHOPAIR(") -> (ex=", current_position[X_AXIS]);
SERIAL_ECHOPAIR(", ey=", current_position[Y_AXIS]);
SERIAL_ECHOPAIR(", ez=", current_position[Z_AXIS]);
SERIAL_CHAR(')');
SERIAL_EOL();
}
plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc
feedrate_mm_s = save_feedrate;
set_destination_from_current();
@ -906,16 +857,13 @@ void GcodeSuite::G26() {
retract_filament(destination);
destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;
//debug_current_and_destination(PSTR("ready to do Z-Raise."));
move_to(destination, 0); // Raise the nozzle
//debug_current_and_destination(PSTR("done doing Z-Raise."));
destination[X_AXIS] = g26_x_pos; // Move back to the starting position
destination[Y_AXIS] = g26_y_pos;
//destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; // Keep the nozzle where it is
move_to(destination, 0); // Move back to the starting position
//debug_current_and_destination(PSTR("done doing X/Y move."));
#if DISABLED(NO_VOLUMETRICS)
parser.volumetric_enabled = volumetric_was_enabled;

View File

@ -1,40 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* M49.cpp - Toggle the G26 debug flag
*/
#include "../../../inc/MarlinConfig.h"
#if ENABLED(G26_MESH_VALIDATION)
#include "../../gcode.h"
#include "../../../feature/bedlevel/bedlevel.h"
void GcodeSuite::M49() {
g26_debug_flag ^= true;
SERIAL_ECHOPGM("G26 Debug: ");
serialprintPGM(g26_debug_flag ? PSTR("On\n") : PSTR("Off\n"));
}
#endif // G26_MESH_VALIDATION

View File

@ -182,7 +182,6 @@
*
*/
void GcodeSuite::G28(const bool always_home_all) {
if (DEBUGGING(LEVELING)) {
DEBUG_ECHOLNPGM(">>> G28");
log_machine_info();
@ -268,13 +267,16 @@ void GcodeSuite::G28(const bool always_home_all) {
const bool homeX = always_home_all || parser.seen('X'),
homeY = always_home_all || parser.seen('Y'),
homeZ = always_home_all || parser.seen('Z'),
home_all = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ);
home_all = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ),
doX = home_all || homeX,
doY = home_all || homeY,
doZ = home_all || homeZ;
set_destination_from_current();
#if Z_HOME_DIR > 0 // If homing away from BED do Z first
if (home_all || homeZ) homeaxis(Z_AXIS);
if (doZ) homeaxis(Z_AXIS);
#endif
@ -285,7 +287,7 @@ void GcodeSuite::G28(const bool always_home_all) {
(parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT)
);
if (z_homing_height && (home_all || homeX || homeY)) {
if (z_homing_height && (doX || doY)) {
// Raise Z before homing any other axes and z is not already high enough (never lower z)
destination[Z_AXIS] = z_homing_height;
if (destination[Z_AXIS] > current_position[Z_AXIS]) {
@ -296,25 +298,25 @@ void GcodeSuite::G28(const bool always_home_all) {
#if ENABLED(QUICK_HOME)
if (home_all || (homeX && homeY)) quick_home_xy();
if (doX && doY) quick_home_xy();
#endif
// Home Y (before X)
#if ENABLED(HOME_Y_BEFORE_X)
if (home_all || homeY
if (doY
#if ENABLED(CODEPENDENT_XY_HOMING)
|| homeX
|| doX
#endif
) homeaxis(Y_AXIS);
#endif
// Home X
if (home_all || homeX
if (doX
#if ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X)
|| homeY
|| doY
#endif
) {
@ -345,12 +347,12 @@ void GcodeSuite::G28(const bool always_home_all) {
// Home Y (after X)
#if DISABLED(HOME_Y_BEFORE_X)
if (home_all || homeY) homeaxis(Y_AXIS);
if (doY) homeaxis(Y_AXIS);
#endif
// Home Z last if homing towards the bed
#if Z_HOME_DIR < 0
if (home_all || homeZ) {
if (doZ) {
#if ENABLED(Z_SAFE_HOMING)
home_z_safely();
#else
@ -361,7 +363,7 @@ void GcodeSuite::G28(const bool always_home_all) {
move_z_after_probing();
#endif
} // home_all || homeZ
} // doZ
#endif // Z_HOME_DIR < 0
sync_plan_position();
@ -402,6 +404,15 @@ void GcodeSuite::G28(const bool always_home_all) {
#endif // DUAL_X_CARRIAGE
#ifdef HOMING_BACKOFF_MM
endstops.enable(false);
constexpr float endstop_backoff[XYZ] = HOMING_BACKOFF_MM;
const float backoff_x = doX ? ABS(endstop_backoff[X_AXIS]) * (X_HOME_DIR) : 0,
backoff_y = doY ? ABS(endstop_backoff[Y_AXIS]) * (Y_HOME_DIR) : 0,
backoff_z = doZ ? ABS(endstop_backoff[Z_AXIS]) * (Z_HOME_DIR) : 0;
if (backoff_z) do_blocking_move_to_z(current_position[Z_AXIS] - backoff_z);
if (backoff_x || backoff_y) do_blocking_move_to_xy(current_position[X_AXIS] - backoff_x, current_position[Y_AXIS] - backoff_y);
#endif
endstops.not_homing();
#if BOTH(DELTA, DELTA_HOME_TO_SAFE_ZONE)
@ -417,7 +428,7 @@ void GcodeSuite::G28(const bool always_home_all) {
// Restore the active tool after homing
#if HOTENDS > 1 && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE))
#if ENABLED(PARKING_EXTRUDER) || ENABLED(DUAL_X_CARRIAGE)
#if EITHER(PARKING_EXTRUDER, DUAL_X_CARRIAGE)
#define NO_FETCH false // fetch the previous toolhead
#else
#define NO_FETCH true
@ -430,9 +441,9 @@ void GcodeSuite::G28(const bool always_home_all) {
report_current_position();
#if ENABLED(NANODLP_Z_SYNC)
#if ENABLED(NANODLP_ALL_AXIS)
#define _HOME_SYNC true // For any axis, output sync text.
#define _HOME_SYNC true // For any axis, output sync text.
#else
#define _HOME_SYNC (home_all || homeZ) // Only for Z-axis
#define _HOME_SYNC doZ // Only for Z-axis
#endif
if (_HOME_SYNC)
SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP);

View File

@ -30,7 +30,7 @@
void M217_report(const bool eeprom=false) {
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
serialprintPGM(eeprom ? PSTR(" M217") : PSTR("Singlenozzle:"));
serialprintPGM(eeprom ? PSTR(" M217") : PSTR("Toolchange:"));
SERIAL_ECHOPAIR(" S", LINEAR_UNIT(toolchange_settings.swap_length));
SERIAL_ECHOPAIR(" P", LINEAR_UNIT(toolchange_settings.prime_speed));
SERIAL_ECHOPAIR(" R", LINEAR_UNIT(toolchange_settings.retract_speed));

View File

@ -47,13 +47,13 @@ inline void toggle_pins() {
for (uint8_t i = start; i <= end; i++) {
pin_t pin = GET_PIN_MAP_PIN(i);
//report_pin_state_extended(pin, ignore_protection, false);
if (!VALID_PIN(pin)) continue;
if (!ignore_protection && pin_is_protected(pin)) {
if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) {
report_pin_state_extended(pin, ignore_protection, true, "Untouched ");
SERIAL_EOL();
}
else {
watchdog_reset();
report_pin_state_extended(pin, ignore_protection, true, "Pulsing ");
#if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO
if (pin == TEENSY_E2) {
@ -77,12 +77,12 @@ inline void toggle_pins() {
{
pinMode(pin, OUTPUT);
for (int16_t j = 0; j < repeat; j++) {
extDigitalWrite(pin, 0); safe_delay(wait);
extDigitalWrite(pin, 1); safe_delay(wait);
extDigitalWrite(pin, 0); safe_delay(wait);
watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait);
watchdog_reset(); extDigitalWrite(pin, 1); safe_delay(wait);
watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait);
watchdog_reset();
}
}
}
SERIAL_EOL();
}
@ -277,7 +277,7 @@ void GcodeSuite::M43() {
for (uint8_t i = first_pin; i <= last_pin; i++) {
pin_t pin = GET_PIN_MAP_PIN(i);
if (!VALID_PIN(pin)) continue;
if (!ignore_protection && pin_is_protected(pin)) continue;
if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) continue;
pinMode(pin, INPUT_PULLUP);
delay(1);
/*
@ -300,7 +300,7 @@ void GcodeSuite::M43() {
for (uint8_t i = first_pin; i <= last_pin; i++) {
pin_t pin = GET_PIN_MAP_PIN(i);
if (!VALID_PIN(pin)) continue;
if (!ignore_protection && pin_is_protected(pin)) continue;
if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) continue;
const byte val =
/*
IS_ANALOG(pin)

View File

@ -53,7 +53,7 @@ uint8_t spindle_laser_power; // = 0
* NOTE: A minimum PWM frequency of 50 Hz is needed. All prescaler
* factors for timers 2, 3, 4, and 5 are acceptable.
*
* SPINDLE_LASER_ENABLE_PIN needs an external pullup or it may power on
* SPINDLE_LASER_ENA_PIN needs an external pullup or it may power on
* the spindle/laser during power-up or when connecting to the host
* (usually goes through a reset which sets all I/O pins to tri-state)
*
@ -73,7 +73,7 @@ inline void delay_for_power_down() { safe_delay(SPINDLE_LASER_POWERDOWN_DELAY);
*/
inline void set_spindle_laser_ocr(const uint8_t ocr) {
WRITE(SPINDLE_LASER_ENABLE_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low)
WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low)
analogWrite(SPINDLE_LASER_PWM_PIN, (SPINDLE_LASER_PWM_INVERT) ? 255 - ocr : ocr);
}
@ -81,7 +81,7 @@ inline void set_spindle_laser_ocr(const uint8_t ocr) {
void update_spindle_laser_power() {
if (spindle_laser_power == 0) {
WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off (active low)
WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off (active low)
analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // only write low byte
delay_for_power_down();
}
@ -101,7 +101,7 @@ inline void set_spindle_laser_ocr(const uint8_t ocr) {
#endif // SPINDLE_LASER_PWM
bool spindle_laser_enabled() {
return !!spindle_laser_power; // READ(SPINDLE_LASER_ENABLE_PIN) == SPINDLE_LASER_ENABLE_INVERT;
return !!spindle_laser_power; // READ(SPINDLE_LASER_ENA_PIN) == SPINDLE_LASER_ENABLE_INVERT;
}
void set_spindle_laser_enabled(const bool enable) {
@ -111,11 +111,11 @@ void set_spindle_laser_enabled(const bool enable) {
update_spindle_laser_power();
#else
if (enable) {
WRITE(SPINDLE_LASER_ENABLE_PIN, SPINDLE_LASER_ENABLE_INVERT);
WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ENABLE_INVERT);
delay_for_power_up();
}
else {
WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT);
WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ENABLE_INVERT);
delay_for_power_down();
}
#endif

View File

@ -42,10 +42,10 @@
*
* M605 S0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel
* results as long as it supports dual X-carriages.
*
*
* M605 S1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so that
* additional slicer support is not required.
*
*
* M605 S2 X R : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with
* the first X-carriage and extruder, to print 2 copies of the same object at the same time.
* Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and

View File

@ -55,7 +55,7 @@ void GcodeSuite::T(const uint8_t tool_index) {
#if ENABLED(PRUSA_MMU2)
if (parser.string_arg) {
mmu2.toolChange(parser.string_arg); // Special commands T?/Tx/Tc
mmu2.tool_change(parser.string_arg); // Special commands T?/Tx/Tc
return;
}
#endif

View File

@ -84,7 +84,7 @@ void GcodeSuite::M701() {
// Load filament
#if ENABLED(PRUSA_MMU2)
mmu2.loadFilamentToNozzle(target_extruder);
mmu2.load_filament_to_nozzle(target_extruder);
#else
constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH;
const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS)

View File

@ -29,17 +29,20 @@
#include "../../../module/motion.h"
#include "../../../lcd/ultralcd.h"
#define DEBUG_OUT ENABLED(DEBUG_POWER_LOSS_RECOVERY)
#include "../../../core/debug_out.h"
void menu_job_recovery();
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
inline void plr_error(PGM_P const prefix) {
SERIAL_ECHO_START();
inline void plr_error(PGM_P const prefix) {
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
DEBUG_ECHO_START();
serialprintPGM(prefix);
SERIAL_ECHOLNPGM(" Power-Loss Recovery Data");
}
#endif
DEBUG_ECHOLNPGM(" Power-Loss Recovery Data");
#else
UNUSED(prefix);
#endif
}
/**
* M1000: Resume from power-loss (undocumented)
@ -54,11 +57,8 @@ void GcodeSuite::M1000() {
else
recovery.resume();
}
else {
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
plr_error(recovery.info.valid_head ? PSTR("No") : PSTR("Invalid"));
#endif
}
else
plr_error(recovery.info.valid_head ? PSTR("No") : PSTR("Invalid"));
}

View File

@ -41,7 +41,7 @@ void GcodeSuite::M403() {
type = parser.intval('F', -1);
if (WITHIN(index, 0, 4) && WITHIN(type, 0, 2))
mmu2.setFilamentType(index, type);
mmu2.set_filament_type(index, type);
else
SERIAL_ECHO_MSG("M403 - bad arguments.");
}

View File

@ -105,7 +105,7 @@ void GcodeSuite::get_destination_from_command() {
#if ENABLED(POWER_LOSS_RECOVERY)
// Only update power loss recovery on moves with E
if ((seen[E_AXIS] || seen[Z_AXIS]) && IS_SD_PRINTING()) recovery.save();
if (seen[E_AXIS] && (seen[X_AXIS] || seen[Y_AXIS]) && IS_SD_PRINTING()) recovery.save();
#endif
if (parser.linearval('F') > 0)
@ -269,6 +269,16 @@ void GcodeSuite::process_parsed_command(
break;
#endif
#if ENABLED(CNC_COORDINATE_SYSTEMS)
case 53: G53(); break;
case 54: G54(); break;
case 55: G55(); break;
case 56: G56(); break;
case 57: G57(); break;
case 58: G58(); break;
case 59: G59(); break;
#endif
#if ENABLED(GCODE_MOTION_MODES)
case 80: G80(); break; // G80: Reset the current motion mode
#endif
@ -348,10 +358,6 @@ void GcodeSuite::process_parsed_command(
case 48: M48(); break; // M48: Z probe repeatability test
#endif
#if ENABLED(G26_MESH_VALIDATION)
case 49: M49(); break; // M49: Turn on or off G26 debug flag for verbose output
#endif
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
case 73: M73(); break; // M73: Set progress percentage (for display on LCD)
#endif

View File

@ -495,10 +495,6 @@ private:
static void M48();
#endif
#if ENABLED(G26_MESH_VALIDATION)
static void M49();
#endif
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
static void M73();
#endif

View File

@ -59,7 +59,7 @@ bool GcodeSuite::select_coordinate_system(const int8_t _new) {
*
* Marlin also uses G53 on a line by itself to go back to native space.
*/
inline void GcodeSuite::G53() {
void GcodeSuite::G53() {
const int8_t _system = active_coordinate_system;
active_coordinate_system = -1;
if (parser.chain()) { // If this command has more following...

View File

@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm

View File

@ -25,6 +25,7 @@
#if ENABLED(BABYSTEPPING)
#include "../gcode.h"
#include "../../feature/babystep.h"
#include "../../module/probe.h"
#include "../../module/temperature.h"
#include "../../module/planner.h"
@ -49,7 +50,7 @@
else {
hotend_offset[Z_AXIS][active_extruder] -= offs;
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR(MSG_IDEX_Z_OFFSET ": ", hotend_offset[Z_AXIS][active_extruder]);
SERIAL_ECHOLNPAIR(MSG_Z_OFFSET ": ", hotend_offset[Z_AXIS][active_extruder]);
}
#endif
}
@ -64,7 +65,7 @@ void GcodeSuite::M290() {
for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) {
const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
thermalManager.babystep_axis((AxisEnum)a, offs * planner.settings.axis_steps_per_mm[a]);
babystep.add_mm((AxisEnum)a, offs);
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
if (a == Z_AXIS && (!parser.seen('P') || parser.value_bool())) mod_zprobe_zoffset(offs);
#endif
@ -72,7 +73,7 @@ void GcodeSuite::M290() {
#else
if (parser.seenval('Z') || parser.seenval('S')) {
const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
thermalManager.babystep_axis(Z_AXIS, offs * planner.settings.axis_steps_per_mm[Z_AXIS]);
babystep.add_mm(Z_AXIS, offs);
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
if (!parser.seen('P') || parser.value_bool()) mod_zprobe_zoffset(offs);
#endif

View File

@ -37,10 +37,6 @@
#include "../feature/leds/printer_event_leds.h"
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../feature/power_loss_recovery.h"
#endif
/**
* GCode line number handling. Hosts may opt to include line numbers when
* sending commands to Marlin, and lines will be checked for sequentiality.

View File

@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm