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

@ -40,7 +40,7 @@ void GcodeSuite::M900() {
#else
const uint8_t tmp_extruder = parser.seenval('T') ? parser.value_int() : active_extruder;
if (tmp_extruder >= EXTRUDERS) {
SERIAL_PROTOCOLLNPGM("?T value out of range.");
SERIAL_ECHOLNPGM("?T value out of range.");
return;
}
#endif
@ -52,7 +52,7 @@ void GcodeSuite::M900() {
planner.extruder_advance_K[tmp_extruder] = newK;
}
else
SERIAL_PROTOCOLLNPGM("?K value out of range (0-10).");
SERIAL_ECHOLNPGM("?K value out of range (0-10).");
}
else {
SERIAL_ECHO_START();

View File

@ -63,7 +63,6 @@ void GcodeSuite::M355() {
else SERIAL_ECHOLNPAIR("Case light: ", case_light_brightness);
}
#else
SERIAL_ERROR_START();
SERIAL_ERRORLNPGM(MSG_ERR_M355_NONE);
SERIAL_ERROR_MSG(MSG_ERR_M355_NONE);
#endif
}

View File

@ -38,10 +38,8 @@ void GcodeSuite::M404() {
filament_width_nominal = parser.value_linear_units();
planner.volumetric_area_nominal = CIRCLE_AREA(filament_width_nominal * 0.5);
}
else {
SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");
SERIAL_PROTOCOLLN(filament_width_nominal);
}
else
SERIAL_ECHOLNPAIR("Filament dia (nominal mm):", filament_width_nominal);
}
/**
@ -79,8 +77,7 @@ void GcodeSuite::M406() {
* M407: Get measured filament diameter on serial output
*/
void GcodeSuite::M407() {
SERIAL_PROTOCOLPGM("Filament dia (measured mm):");
SERIAL_PROTOCOLLN(filament_width_meas);
SERIAL_ECHOLNPAIR("Filament dia (measured mm):", filament_width_meas);
}
#endif // FILAMENT_WIDTH_SENSOR

View File

@ -68,13 +68,10 @@ void GcodeSuite::M261() {
uint8_t bytes = parser.byteval('B', 1);
if (i2c.addr && bytes && bytes <= TWIBUS_BUFFER_SIZE) {
if (i2c.addr && bytes && bytes <= TWIBUS_BUFFER_SIZE)
i2c.relay(bytes);
}
else {
SERIAL_ERROR_START();
SERIAL_ERRORLNPGM("Bad i2c request");
}
else
SERIAL_ERROR_MSG("Bad i2c request");
}
#endif

View File

@ -45,10 +45,8 @@ void GcodeSuite::M810_819() {
if (len) {
// Set a macro
if (len > GCODE_MACROS_SLOT_SIZE) {
SERIAL_ERROR_START();
SERIAL_ERRORLNPGM("Macro too long.");
}
if (len > GCODE_MACROS_SLOT_SIZE)
SERIAL_ERROR_MSG("Macro too long.");
else {
char c, *s = parser.string_arg, *d = gcode_macros[index];
do {