A single SERIAL_ECHO macro type (#12557)

This commit is contained in:
Scott Lahteine
2018-11-29 16:58:58 -06:00
committed by GitHub
parent 69d869c3d9
commit c986239837
86 changed files with 1016 additions and 1356 deletions

View File

@ -39,7 +39,7 @@
#include "../../../module/stepper.h"
// Save 130 bytes with non-duplication of PSTR
inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_PROTOCOLLNPGM(" not entered."); }
inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" not entered."); }
/**
* G29: Mesh-based Z probe, probes a grid and produces a
@ -64,7 +64,7 @@ void GcodeSuite::G29() {
MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport);
if (!WITHIN(state, 0, 5)) {
SERIAL_PROTOCOLLNPGM("S out of range (0-5).");
SERIAL_ECHOLNPGM("S out of range (0-5).");
return;
}
@ -72,13 +72,13 @@ void GcodeSuite::G29() {
switch (state) {
case MeshReport:
SERIAL_PROTOCOLPGM("Mesh Bed Leveling ");
SERIAL_ECHOPGM("Mesh Bed Leveling ");
if (leveling_is_valid()) {
serialprintln_onoff(planner.leveling_active);
mbl.report_mesh();
}
else
SERIAL_PROTOCOLLNPGM("has no data.");
SERIAL_ECHOLNPGM("has no data.");
break;
case MeshStart:
@ -92,7 +92,7 @@ void GcodeSuite::G29() {
case MeshNext:
if (mbl_probe_index < 0) {
SERIAL_PROTOCOLLNPGM("Start mesh probing with \"G29 S1\" first.");
SERIAL_ECHOLNPGM("Start mesh probing with \"G29 S1\" first.");
return;
}
// For each G29 S2...
@ -130,7 +130,7 @@ void GcodeSuite::G29() {
// After recording the last point, activate home and activate
mbl_probe_index = -1;
SERIAL_PROTOCOLLNPGM("Mesh probing done.");
SERIAL_ECHOLNPGM("Mesh probing done.");
BUZZ(100, 659);
BUZZ(100, 698);
@ -154,8 +154,8 @@ void GcodeSuite::G29() {
if (parser.seenval('I')) {
ix = parser.value_int();
if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) {
SERIAL_PROTOCOLPAIR("I out of range (0-", int(GRID_MAX_POINTS_X - 1));
SERIAL_PROTOCOLLNPGM(")");
SERIAL_ECHOPAIR("I out of range (0-", int(GRID_MAX_POINTS_X - 1));
SERIAL_ECHOLNPGM(")");
return;
}
}
@ -165,8 +165,8 @@ void GcodeSuite::G29() {
if (parser.seenval('J')) {
iy = parser.value_int();
if (!WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) {
SERIAL_PROTOCOLPAIR("J out of range (0-", int(GRID_MAX_POINTS_Y - 1));
SERIAL_PROTOCOLLNPGM(")");
SERIAL_ECHOPAIR("J out of range (0-", int(GRID_MAX_POINTS_Y - 1));
SERIAL_ECHOLNPGM(")");
return;
}
}
@ -193,8 +193,8 @@ void GcodeSuite::G29() {
} // switch(state)
if (state == MeshNext) {
SERIAL_PROTOCOLPAIR("MBL G29 point ", MIN(mbl_probe_index, GRID_MAX_POINTS));
SERIAL_PROTOCOLLNPAIR(" of ", int(GRID_MAX_POINTS));
SERIAL_ECHOPAIR("MBL G29 point ", MIN(mbl_probe_index, GRID_MAX_POINTS));
SERIAL_ECHOLNPAIR(" of ", int(GRID_MAX_POINTS));
}
report_current_position();

View File

@ -48,14 +48,10 @@ void GcodeSuite::M421() {
const int8_t iy = hasJ ? parser.value_int() : hasY ? mbl.probe_index_y(RAW_Y_POSITION(parser.value_linear_units())) : -1;
const bool hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q');
if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ)) {
SERIAL_ERROR_START();
SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS);
}
else if (ix < 0 || iy < 0) {
SERIAL_ERROR_START();
SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY);
}
if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ))
SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS);
else if (ix < 0 || iy < 0)
SERIAL_ERROR_MSG(MSG_ERR_MESH_XY);
else
mbl.set_z(ix, iy, parser.value_linear_units() + (hasQ ? mbl.z_values[ix][iy] : 0));
}