update code base to Marlin 2.0.9.2
This commit is contained in:
7
Marlin/src/gcode/host/M110.cpp
Executable file → Normal file
7
Marlin/src/gcode/host/M110.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -27,5 +27,8 @@
|
||||
* M110: Set Current Line Number
|
||||
*/
|
||||
void GcodeSuite::M110() {
|
||||
if (parser.seenval('N')) queue.last_N = parser.value_long();
|
||||
|
||||
if (parser.seenval('N'))
|
||||
queue.set_current_line_number(parser.value_long());
|
||||
|
||||
}
|
||||
|
10
Marlin/src/gcode/host/M113.cpp
Executable file → Normal file
10
Marlin/src/gcode/host/M113.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
* S<seconds> Optional. Set the keepalive interval.
|
||||
*/
|
||||
void GcodeSuite::M113() {
|
||||
|
||||
if (parser.seenval('S')) {
|
||||
host_keepalive_interval = parser.value_byte();
|
||||
NOMORE(host_keepalive_interval, 60);
|
||||
}
|
||||
else {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR("M113 S", (unsigned long)host_keepalive_interval);
|
||||
}
|
||||
else
|
||||
SERIAL_ECHO_MSG("M113 S", host_keepalive_interval);
|
||||
|
||||
}
|
||||
|
||||
#endif // HOST_KEEPALIVE_FEATURE
|
||||
|
79
Marlin/src/gcode/host/M114.cpp
Executable file → Normal file
79
Marlin/src/gcode/host/M114.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -34,34 +34,34 @@
|
||||
#include "../../core/debug_out.h"
|
||||
#endif
|
||||
|
||||
void report_xyze(const xyze_pos_t &pos, const uint8_t n=XYZE, const uint8_t precision=3) {
|
||||
void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=XYZE, const uint8_t precision=3) {
|
||||
char str[12];
|
||||
LOOP_L_N(a, n) {
|
||||
SERIAL_CHAR(' ', axis_codes[a], ':');
|
||||
if (pos[a] >= 0) SERIAL_CHAR(' ');
|
||||
SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
|
||||
}
|
||||
SERIAL_EOL();
|
||||
}
|
||||
inline void report_xyz(const xyze_pos_t &pos) { report_xyze(pos, 3); }
|
||||
inline void report_linear_axis_pos(const xyze_pos_t &pos) { report_all_axis_pos(pos, XYZ); }
|
||||
|
||||
void report_xyz(const xyz_pos_t &pos, const uint8_t precision=3) {
|
||||
void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) {
|
||||
char str[12];
|
||||
LOOP_XYZ(a) {
|
||||
SERIAL_CHAR(' ', XYZ_CHAR(a), ':');
|
||||
LOOP_LINEAR_AXES(a) {
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a), ':');
|
||||
SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
|
||||
}
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
void report_current_position_detail() {
|
||||
|
||||
// Position as sent by G-code
|
||||
SERIAL_ECHOPGM("\nLogical:");
|
||||
report_xyz(current_position.asLogical());
|
||||
report_linear_axis_pos(current_position.asLogical());
|
||||
|
||||
// Cartesian position in native machine space
|
||||
SERIAL_ECHOPGM("Raw: ");
|
||||
report_xyz(current_position);
|
||||
report_linear_axis_pos(current_position);
|
||||
|
||||
xyze_pos_t leveled = current_position;
|
||||
|
||||
@@ -69,24 +69,20 @@
|
||||
// Current position with leveling applied
|
||||
SERIAL_ECHOPGM("Leveled:");
|
||||
planner.apply_leveling(leveled);
|
||||
report_xyz(leveled);
|
||||
report_linear_axis_pos(leveled);
|
||||
|
||||
// Test planner un-leveling. This should match the Raw result.
|
||||
SERIAL_ECHOPGM("UnLevel:");
|
||||
xyze_pos_t unleveled = leveled;
|
||||
planner.unapply_leveling(unleveled);
|
||||
report_xyz(unleveled);
|
||||
report_linear_axis_pos(unleveled);
|
||||
#endif
|
||||
|
||||
#if IS_KINEMATIC
|
||||
// Kinematics applied to the leveled position
|
||||
#if IS_SCARA
|
||||
SERIAL_ECHOPGM("ScaraK: ");
|
||||
#else
|
||||
SERIAL_ECHOPGM("DeltaK: ");
|
||||
#endif
|
||||
SERIAL_ECHOPGM(TERN(IS_SCARA, "ScaraK: ", "DeltaK: "));
|
||||
inverse_kinematics(leveled); // writes delta[]
|
||||
report_xyz(delta);
|
||||
report_linear_axis_pos(delta);
|
||||
#endif
|
||||
|
||||
planner.synchronize();
|
||||
@@ -129,6 +125,15 @@
|
||||
#if AXIS_IS_L64XX(Z4)
|
||||
REPORT_ABSOLUTE_POS(Z4);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(I)
|
||||
REPORT_ABSOLUTE_POS(I);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(J)
|
||||
REPORT_ABSOLUTE_POS(J);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(K)
|
||||
REPORT_ABSOLUTE_POS(K);
|
||||
#endif
|
||||
#if AXIS_IS_L64XX(E0)
|
||||
REPORT_ABSOLUTE_POS(E0);
|
||||
#endif
|
||||
@@ -157,7 +162,7 @@
|
||||
#endif // HAS_L64XX
|
||||
|
||||
SERIAL_ECHOPGM("Stepper:");
|
||||
LOOP_XYZE(i) {
|
||||
LOOP_LOGICAL_AXES(i) {
|
||||
SERIAL_CHAR(' ', axis_codes[i], ':');
|
||||
SERIAL_ECHO(stepper.position((AxisEnum)i));
|
||||
}
|
||||
@@ -169,17 +174,25 @@
|
||||
planner.get_axis_position_degrees(B_AXIS)
|
||||
};
|
||||
SERIAL_ECHOPGM("Degrees:");
|
||||
report_xyze(deg, 2);
|
||||
report_all_axis_pos(deg, 2);
|
||||
#endif
|
||||
|
||||
SERIAL_ECHOPGM("FromStp:");
|
||||
get_cartesian_from_steppers(); // writes 'cartes' (with forward kinematics)
|
||||
xyze_pos_t from_steppers = { cartes.x, cartes.y, cartes.z, planner.get_axis_position_mm(E_AXIS) };
|
||||
report_xyze(from_steppers);
|
||||
xyze_pos_t from_steppers = LOGICAL_AXIS_ARRAY(
|
||||
planner.get_axis_position_mm(E_AXIS),
|
||||
cartes.x, cartes.y, cartes.z,
|
||||
planner.get_axis_position_mm(I_AXIS),
|
||||
planner.get_axis_position_mm(J_AXIS),
|
||||
planner.get_axis_position_mm(K_AXIS)
|
||||
);
|
||||
report_all_axis_pos(from_steppers);
|
||||
|
||||
const xyze_float_t diff = from_steppers - leveled;
|
||||
SERIAL_ECHOPGM("Diff: ");
|
||||
report_xyze(diff);
|
||||
SERIAL_ECHOPGM("Diff: ");
|
||||
report_all_axis_pos(diff);
|
||||
|
||||
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
|
||||
}
|
||||
|
||||
#endif // M114_DETAIL
|
||||
@@ -195,7 +208,7 @@
|
||||
void GcodeSuite::M114() {
|
||||
|
||||
#if ENABLED(M114_DETAIL)
|
||||
if (parser.seen('D')) {
|
||||
if (parser.seen_test('D')) {
|
||||
#if DISABLED(M114_LEGACY)
|
||||
planner.synchronize();
|
||||
#endif
|
||||
@@ -203,18 +216,20 @@ void GcodeSuite::M114() {
|
||||
report_current_position_detail();
|
||||
return;
|
||||
}
|
||||
if (parser.seen('E')) {
|
||||
SERIAL_ECHOLNPAIR("Count E:", stepper.position(E_AXIS));
|
||||
return;
|
||||
}
|
||||
#if HAS_EXTRUDERS
|
||||
if (parser.seen_test('E')) {
|
||||
SERIAL_ECHOLNPGM("Count E:", stepper.position(E_AXIS));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(M114_REALTIME)
|
||||
if (parser.seen('R')) { report_real_position(); return; }
|
||||
if (parser.seen_test('R')) { report_real_position(); return; }
|
||||
#endif
|
||||
|
||||
#if ENABLED(M114_LEGACY)
|
||||
planner.synchronize();
|
||||
#endif
|
||||
TERN_(M114_LEGACY, planner.synchronize());
|
||||
report_current_position_projected();
|
||||
|
||||
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
|
||||
}
|
||||
|
112
Marlin/src/gcode/host/M115.cpp
Executable file → Normal file
112
Marlin/src/gcode/host/M115.cpp
Executable file → Normal file
@@ -16,19 +16,29 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../queue.h" // for getting the command port
|
||||
|
||||
|
||||
#if ENABLED(M115_GEOMETRY_REPORT)
|
||||
#include "../../module/motion.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(CASE_LIGHT_ENABLE)
|
||||
#include "../../feature/caselight.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
|
||||
static void cap_line(PGM_P const name, bool ena=false) {
|
||||
SERIAL_ECHOPGM("Cap:");
|
||||
serialprintPGM(name);
|
||||
SERIAL_CHAR(':');
|
||||
SERIAL_ECHOLN(int(ena ? 1 : 0));
|
||||
SERIAL_ECHOPGM_P(name);
|
||||
SERIAL_CHAR(':', '0' + ena);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -38,26 +48,36 @@
|
||||
* the capability is not present.
|
||||
*/
|
||||
void GcodeSuite::M115() {
|
||||
|
||||
SERIAL_ECHOLNPGM(STR_M115_REPORT);
|
||||
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) " "
|
||||
#if LINEAR_AXES != XYZ
|
||||
"AXIS_COUNT:" STRINGIFY(LINEAR_AXES) " "
|
||||
#endif
|
||||
#ifdef MACHINE_UUID
|
||||
"UUID:" MACHINE_UUID
|
||||
#endif
|
||||
);
|
||||
|
||||
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
|
||||
|
||||
// The port that sent M115
|
||||
serial_index_t port = queue.ring_buffer.command_port();
|
||||
|
||||
// PAREN_COMMENTS
|
||||
#if ENABLED(PAREN_COMMENTS)
|
||||
cap_line(PSTR("PAREN_COMMENTS"), true);
|
||||
#endif
|
||||
TERN_(PAREN_COMMENTS, cap_line(PSTR("PAREN_COMMENTS"), true));
|
||||
|
||||
// QUOTED_STRINGS
|
||||
#if ENABLED(GCODE_QUOTED_STRINGS)
|
||||
cap_line(PSTR("QUOTED_STRINGS"), true);
|
||||
#endif
|
||||
TERN_(GCODE_QUOTED_STRINGS, cap_line(PSTR("QUOTED_STRINGS"), true));
|
||||
|
||||
// SERIAL_XON_XOFF
|
||||
cap_line(PSTR("SERIAL_XON_XOFF"), ENABLED(SERIAL_XON_XOFF));
|
||||
|
||||
// BINARY_FILE_TRANSFER (M28 B1)
|
||||
cap_line(PSTR("BINARY_FILE_TRANSFER"), ENABLED(BINARY_FILE_TRANSFER));
|
||||
cap_line(PSTR("BINARY_FILE_TRANSFER"), ENABLED(BINARY_FILE_TRANSFER)); // TODO: Use SERIAL_IMPL.has_feature(port, SerialFeature::BinaryFileTransfer) once implemented
|
||||
|
||||
// EEPROM (M500, M501)
|
||||
cap_line(PSTR("EEPROM"), ENABLED(EEPROM_SETTINGS));
|
||||
@@ -65,6 +85,9 @@ void GcodeSuite::M115() {
|
||||
// Volumetric Extrusion (M200)
|
||||
cap_line(PSTR("VOLUMETRIC"), DISABLED(NO_VOLUMETRICS));
|
||||
|
||||
// AUTOREPORT_POS (M154)
|
||||
cap_line(PSTR("AUTOREPORT_POS"), ENABLED(AUTO_REPORT_POSITION));
|
||||
|
||||
// AUTOREPORT_TEMP (M155)
|
||||
cap_line(PSTR("AUTOREPORT_TEMP"), ENABLED(AUTO_REPORT_TEMPERATURES));
|
||||
|
||||
@@ -77,6 +100,9 @@ void GcodeSuite::M115() {
|
||||
// AUTOLEVEL (G29)
|
||||
cap_line(PSTR("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
|
||||
|
||||
// RUNOUT (M412, M600)
|
||||
cap_line(PSTR("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR));
|
||||
|
||||
// Z_PROBE (G30)
|
||||
cap_line(PSTR("Z_PROBE"), ENABLED(HAS_BED_PROBE));
|
||||
|
||||
@@ -89,31 +115,79 @@ void GcodeSuite::M115() {
|
||||
// SOFTWARE_POWER (M80, M81)
|
||||
cap_line(PSTR("SOFTWARE_POWER"), ENABLED(PSU_CONTROL));
|
||||
|
||||
// CASE LIGHTS (M355)
|
||||
cap_line(PSTR("TOGGLE_LIGHTS"), ENABLED(HAS_CASE_LIGHT));
|
||||
|
||||
cap_line(PSTR("CASE_LIGHT_BRIGHTNESS"), TERN(HAS_CASE_LIGHT, PWM_PIN(CASE_LIGHT_PIN), 0));
|
||||
// TOGGLE_LIGHTS (M355)
|
||||
cap_line(PSTR("TOGGLE_LIGHTS"), ENABLED(CASE_LIGHT_ENABLE));
|
||||
cap_line(PSTR("CASE_LIGHT_BRIGHTNESS"), TERN0(CASE_LIGHT_ENABLE, caselight.has_brightness()));
|
||||
|
||||
// EMERGENCY_PARSER (M108, M112, M410, M876)
|
||||
cap_line(PSTR("EMERGENCY_PARSER"), ENABLED(EMERGENCY_PARSER));
|
||||
|
||||
// HOST ACTION COMMANDS (paused, resume, resumed, cancel, etc.)
|
||||
cap_line(PSTR("HOST_ACTION_COMMANDS"), ENABLED(HOST_ACTION_COMMANDS));
|
||||
|
||||
// PROMPT SUPPORT (M876)
|
||||
cap_line(PSTR("PROMPT_SUPPORT"), ENABLED(HOST_PROMPT_SUPPORT));
|
||||
|
||||
// SDCARD (M20, M23, M24, etc.)
|
||||
cap_line(PSTR("SDCARD"), ENABLED(SDSUPPORT));
|
||||
|
||||
// REPEAT (M808)
|
||||
cap_line(PSTR("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS));
|
||||
|
||||
// SD_WRITE (M928, M28, M29)
|
||||
cap_line(PSTR("SD_WRITE"), ENABLED(SDSUPPORT) && DISABLED(SDCARD_READONLY));
|
||||
|
||||
// AUTOREPORT_SD_STATUS (M27 extension)
|
||||
cap_line(PSTR("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS));
|
||||
|
||||
// LONG_FILENAME_HOST_SUPPORT (M33)
|
||||
cap_line(PSTR("LONG_FILENAME"), ENABLED(LONG_FILENAME_HOST_SUPPORT));
|
||||
|
||||
// THERMAL_PROTECTION
|
||||
cap_line(PSTR("THERMAL_PROTECTION"), ENABLED(THERMALLY_SAFE));
|
||||
|
||||
// MOTION_MODES (M80-M89)
|
||||
cap_line(PSTR("MOTION_MODES"), ENABLED(GCODE_MOTION_MODES));
|
||||
|
||||
// ARC_SUPPORT (G2-G3)
|
||||
cap_line(PSTR("ARCS"), ENABLED(ARC_SUPPORT));
|
||||
|
||||
// BABYSTEPPING (M290)
|
||||
cap_line(PSTR("BABYSTEPPING"), ENABLED(BABYSTEPPING));
|
||||
|
||||
// CHAMBER_TEMPERATURE (M141, M191)
|
||||
cap_line(PSTR("CHAMBER_TEMPERATURE"), ENABLED(HAS_HEATED_CHAMBER));
|
||||
|
||||
// MEATPACK Compresson
|
||||
cap_line(PSTR("MEATPACK"), ENABLED(MEATPACK));
|
||||
// COOLER_TEMPERATURE (M143, M193)
|
||||
cap_line(PSTR("COOLER_TEMPERATURE"), ENABLED(HAS_COOLER));
|
||||
|
||||
// MEATPACK Compression
|
||||
cap_line(PSTR("MEATPACK"), SERIAL_IMPL.has_feature(port, SerialFeature::MeatPack));
|
||||
|
||||
// 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 };
|
||||
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, "}"
|
||||
"},"
|
||||
"work:{"
|
||||
"min:{x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z, "},"
|
||||
"max:{x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z, "}",
|
||||
"}"
|
||||
"}"
|
||||
);
|
||||
#endif
|
||||
|
||||
#endif // EXTENDED_CAPABILITIES_REPORT
|
||||
}
|
||||
|
25
Marlin/src/gcode/host/M118.cpp
Executable file → Normal file
25
Marlin/src/gcode/host/M118.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
*/
|
||||
void GcodeSuite::M118() {
|
||||
bool hasE = false, hasA = false;
|
||||
#if NUM_SERIAL > 1
|
||||
#if HAS_MULTI_SERIAL
|
||||
int8_t port = -1; // Assume no redirect
|
||||
#endif
|
||||
char *p = parser.string_arg;
|
||||
@@ -44,7 +44,7 @@ void GcodeSuite::M118() {
|
||||
switch (p[0]) {
|
||||
case 'A': hasA = true; break;
|
||||
case 'E': hasE = true; break;
|
||||
#if NUM_SERIAL > 1
|
||||
#if HAS_MULTI_SERIAL
|
||||
case 'P': port = p[1] - '0'; break;
|
||||
#endif
|
||||
}
|
||||
@@ -52,24 +52,9 @@ void GcodeSuite::M118() {
|
||||
while (*p == ' ') ++p;
|
||||
}
|
||||
|
||||
#if NUM_SERIAL > 1
|
||||
const serial_index_t old_serial = serial_port_index;
|
||||
if (WITHIN(port, 0, NUM_SERIAL))
|
||||
serial_port_index = (
|
||||
port == 0 ? SERIAL_BOTH
|
||||
: port == 1 ? SERIAL_PORT
|
||||
#ifdef SERIAL_PORT_2
|
||||
: port == 2 ? SERIAL_PORT_2
|
||||
#endif
|
||||
: SERIAL_PORT
|
||||
);
|
||||
#endif
|
||||
PORT_REDIRECT(WITHIN(port, 0, NUM_SERIAL) ? (port ? SERIAL_PORTMASK(port - 1) : SerialMask::All) : multiSerial.portMask);
|
||||
|
||||
if (hasE) SERIAL_ECHO_START();
|
||||
if (hasA) SERIAL_ECHOPGM("// ");
|
||||
if (hasA) SERIAL_ECHOPGM("//");
|
||||
SERIAL_ECHOLN(p);
|
||||
|
||||
#if NUM_SERIAL > 1
|
||||
serial_port_index = old_serial;
|
||||
#endif
|
||||
}
|
||||
|
2
Marlin/src/gcode/host/M119.cpp
Executable file → Normal file
2
Marlin/src/gcode/host/M119.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
40
Marlin/src/gcode/host/M154.cpp
Normal file
40
Marlin/src/gcode/host/M154.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(AUTO_REPORT_POSITION)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../module/motion.h"
|
||||
|
||||
/**
|
||||
* M154: Set position auto-report interval. M154 S<seconds>
|
||||
*/
|
||||
void GcodeSuite::M154() {
|
||||
|
||||
if (parser.seenval('S'))
|
||||
position_auto_reporter.set_interval(parser.value_byte());
|
||||
|
||||
}
|
||||
|
||||
#endif // AUTO_REPORT_POSITION
|
4
Marlin/src/gcode/host/M16.cpp
Executable file → Normal file
4
Marlin/src/gcode/host/M16.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
void GcodeSuite::M16() {
|
||||
|
||||
if (strcmp_P(parser.string_arg, PSTR(MACHINE_NAME)))
|
||||
kill(GET_TEXT(MSG_EXPECTED_PRINTER));
|
||||
kill(GET_TEXT(MSG_KILL_EXPECTED_PRINTER));
|
||||
|
||||
}
|
||||
|
||||
|
186
Marlin/src/gcode/host/M360.cpp
Normal file
186
Marlin/src/gcode/host/M360.cpp
Normal file
@@ -0,0 +1,186 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(REPETIER_GCODE_M360)
|
||||
|
||||
#include "../gcode.h"
|
||||
|
||||
#include "../../module/motion.h"
|
||||
#include "../../module/planner.h"
|
||||
|
||||
#if HAS_EXTRUDERS
|
||||
#include "../../module/temperature.h"
|
||||
#endif
|
||||
|
||||
static void config_prefix(PGM_P const name, PGM_P const pref=nullptr, const int8_t ind=-1) {
|
||||
SERIAL_ECHOPGM("Config:");
|
||||
if (pref) SERIAL_ECHOPGM_P(pref);
|
||||
if (ind >= 0) { SERIAL_ECHO(ind); SERIAL_CHAR(':'); }
|
||||
SERIAL_ECHOPGM_P(name, AS_CHAR(':'));
|
||||
}
|
||||
static void config_line(PGM_P const name, const float val, PGM_P const pref=nullptr, const int8_t ind=-1) {
|
||||
config_prefix(name, pref, ind);
|
||||
SERIAL_ECHOLN(val);
|
||||
}
|
||||
static void config_line_e(const int8_t e, PGM_P const name, const float val) {
|
||||
config_line(name, val, PSTR("Extr."), e + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* M360: Report Firmware configuration
|
||||
* in RepRapFirmware-compatible format
|
||||
*/
|
||||
void GcodeSuite::M360() {
|
||||
PGMSTR(X_STR, "X");
|
||||
PGMSTR(Y_STR, "Y");
|
||||
PGMSTR(Z_STR, "Z");
|
||||
PGMSTR(JERK_STR, "Jerk");
|
||||
|
||||
//
|
||||
// Basics and Enabled items
|
||||
//
|
||||
config_line(PSTR("Baudrate"), BAUDRATE);
|
||||
config_line(PSTR("InputBuffer"), MAX_CMD_SIZE);
|
||||
config_line(PSTR("PrintlineCache"), BUFSIZE);
|
||||
config_line(PSTR("MixingExtruder"), ENABLED(MIXING_EXTRUDER));
|
||||
config_line(PSTR("SDCard"), ENABLED(SDSUPPORT));
|
||||
config_line(PSTR("Fan"), ENABLED(HAS_FAN));
|
||||
config_line(PSTR("LCD"), ENABLED(HAS_DISPLAY));
|
||||
config_line(PSTR("SoftwarePowerSwitch"), 1);
|
||||
config_line(PSTR("SupportLocalFilamentchange"), ENABLED(ADVANCED_PAUSE_FEATURE));
|
||||
config_line(PSTR("CaseLights"), ENABLED(CASE_LIGHT_ENABLE));
|
||||
config_line(PSTR("ZProbe"), ENABLED(HAS_BED_PROBE));
|
||||
config_line(PSTR("Autolevel"), ENABLED(HAS_LEVELING));
|
||||
config_line(PSTR("EEPROM"), ENABLED(EEPROM_SETTINGS));
|
||||
|
||||
//
|
||||
// Homing Directions
|
||||
//
|
||||
PGMSTR(H_DIR_STR, "HomeDir");
|
||||
config_line(H_DIR_STR, X_HOME_DIR, X_STR);
|
||||
config_line(H_DIR_STR, Y_HOME_DIR, Y_STR);
|
||||
config_line(H_DIR_STR, Z_HOME_DIR, Z_STR);
|
||||
|
||||
//
|
||||
// XYZ Axis Jerk
|
||||
//
|
||||
#if HAS_CLASSIC_JERK
|
||||
if (planner.max_jerk.x == planner.max_jerk.y)
|
||||
config_line(PSTR("XY"), planner.max_jerk.x, JERK_STR);
|
||||
else {
|
||||
config_line(X_STR, planner.max_jerk.x, JERK_STR);
|
||||
config_line(Y_STR, planner.max_jerk.y, JERK_STR);
|
||||
}
|
||||
config_line(Z_STR, planner.max_jerk.z, JERK_STR);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Firmware Retraction
|
||||
//
|
||||
config_line(PSTR("SupportG10G11"), ENABLED(FWRETRACT));
|
||||
#if ENABLED(FWRETRACT)
|
||||
PGMSTR(RET_STR, "Retraction");
|
||||
PGMSTR(UNRET_STR, "RetractionUndo");
|
||||
PGMSTR(SPEED_STR, "Speed");
|
||||
// M10 Retract with swap (long) moves
|
||||
config_line(PSTR("Length"), fwretract.settings.retract_length, RET_STR);
|
||||
config_line(SPEED_STR, fwretract.settings.retract_feedrate_mm_s, RET_STR);
|
||||
config_line(PSTR("ZLift"), fwretract.settings.retract_zraise, RET_STR);
|
||||
config_line(PSTR("LongLength"), fwretract.settings.swap_retract_length, RET_STR);
|
||||
// M11 Recover (undo) with swap (long) moves
|
||||
config_line(SPEED_STR, fwretract.settings.retract_recover_feedrate_mm_s, UNRET_STR);
|
||||
config_line(PSTR("ExtraLength"), fwretract.settings.retract_recover_extra, UNRET_STR);
|
||||
config_line(PSTR("ExtraLongLength"), fwretract.settings.swap_retract_recover_extra, UNRET_STR);
|
||||
config_line(PSTR("LongSpeed"), fwretract.settings.swap_retract_recover_feedrate_mm_s, UNRET_STR);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Workspace boundaries
|
||||
//
|
||||
const xyz_pos_t dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
|
||||
dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
|
||||
xyz_pos_t cmin = dmin, cmax = dmax;
|
||||
apply_motion_limits(cmin);
|
||||
apply_motion_limits(cmax);
|
||||
const xyz_pos_t wmin = cmin.asLogical(), wmax = cmax.asLogical();
|
||||
|
||||
PGMSTR(MIN_STR, "Min");
|
||||
PGMSTR(MAX_STR, "Max");
|
||||
PGMSTR(SIZE_STR, "Size");
|
||||
config_line(MIN_STR, wmin.x, X_STR);
|
||||
config_line(MIN_STR, wmin.y, Y_STR);
|
||||
config_line(MIN_STR, wmin.z, Z_STR);
|
||||
config_line(MAX_STR, wmax.x, X_STR);
|
||||
config_line(MAX_STR, wmax.y, Y_STR);
|
||||
config_line(MAX_STR, wmax.z, Z_STR);
|
||||
config_line(SIZE_STR, wmax.x - wmin.x, X_STR);
|
||||
config_line(SIZE_STR, wmax.y - wmin.y, Y_STR);
|
||||
config_line(SIZE_STR, wmax.z - wmin.z, Z_STR);
|
||||
|
||||
//
|
||||
// Print and Travel Acceleration
|
||||
//
|
||||
#define _ACCEL(A,B) _MIN(planner.settings.max_acceleration_mm_per_s2[A##_AXIS], planner.settings.B)
|
||||
PGMSTR(P_ACC_STR, "PrintAccel");
|
||||
PGMSTR(T_ACC_STR, "TravelAccel");
|
||||
config_line(P_ACC_STR, _ACCEL(X, acceleration), X_STR);
|
||||
config_line(P_ACC_STR, _ACCEL(Y, acceleration), Y_STR);
|
||||
config_line(P_ACC_STR, _ACCEL(Z, acceleration), Z_STR);
|
||||
config_line(T_ACC_STR, _ACCEL(X, travel_acceleration), X_STR);
|
||||
config_line(T_ACC_STR, _ACCEL(Y, travel_acceleration), Y_STR);
|
||||
config_line(T_ACC_STR, _ACCEL(Z, travel_acceleration), Z_STR);
|
||||
|
||||
config_prefix(PSTR("PrinterType"));
|
||||
SERIAL_ECHOLNPGM(
|
||||
TERN_(DELTA, "Delta")
|
||||
TERN_(IS_SCARA, "SCARA")
|
||||
TERN_(IS_CORE, "Core")
|
||||
TERN_(MARKFORGED_XY, "MarkForged")
|
||||
TERN_(IS_CARTESIAN, "Cartesian")
|
||||
);
|
||||
|
||||
//
|
||||
// Heated Bed
|
||||
//
|
||||
config_line(PSTR("HeatedBed"), ENABLED(HAS_HEATED_BED));
|
||||
#if HAS_HEATED_BED
|
||||
config_line(PSTR("MaxBedTemp"), BED_MAX_TARGET);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Per-Extruder settings
|
||||
//
|
||||
config_line(PSTR("NumExtruder"), EXTRUDERS);
|
||||
#if HAS_EXTRUDERS
|
||||
LOOP_L_N(e, EXTRUDERS) {
|
||||
config_line_e(e, JERK_STR, TERN(HAS_LINEAR_E_JERK, planner.max_e_jerk[E_INDEX_N(e)], TERN(HAS_CLASSIC_JERK, planner.max_jerk.e, DEFAULT_EJERK)));
|
||||
config_line_e(e, PSTR("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(e)]);
|
||||
config_line_e(e, PSTR("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(e)]);
|
||||
config_line_e(e, PSTR("Diameter"), TERN(NO_VOLUMETRICS, DEFAULT_NOMINAL_FILAMENT_DIA, planner.filament_size[e]));
|
||||
config_line_e(e, PSTR("MaxTemp"), thermalManager.hotend_maxtemp[e]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
3
Marlin/src/gcode/host/M876.cpp
Executable file → Normal file
3
Marlin/src/gcode/host/M876.cpp
Executable file → Normal file
@@ -16,9 +16,10 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
|
||||
|
Reference in New Issue
Block a user