Browse Source

Replace the "ok" in M280, M301, M304, M851 with output not including an "ok"

Replace the "ok" in M280, M301, M304, M851 with output not including an "ok"
to avoid senting two "ok"s for a single g-code.

Doing the same for M105 would break the input filters of the hosts.
For M105 the other "ok" is omitted.
pull/1/head
AnHardt 9 years ago
parent
commit
efbd705eda
  1. 62
      Marlin/Marlin_main.cpp

62
Marlin/Marlin_main.cpp

@ -4749,19 +4749,18 @@ inline void gcode_M226() {
if (servo_index >= 0 && servo_index < NUM_SERVOS) if (servo_index >= 0 && servo_index < NUM_SERVOS)
servo[servo_index].move(servo_position); servo[servo_index].move(servo_position);
else { else {
SERIAL_ECHO_START; SERIAL_ERROR_START;
SERIAL_ECHO("Servo "); SERIAL_ERROR("Servo ");
SERIAL_ECHO(servo_index); SERIAL_ERROR(servo_index);
SERIAL_ECHOLN(" out of range"); SERIAL_ERRORLN(" out of range");
} }
} }
else if (servo_index >= 0) { else if (servo_index >= 0) {
SERIAL_PROTOCOL(MSG_OK); SERIAL_ECHO_START;
SERIAL_PROTOCOL(" Servo "); SERIAL_ECHO(" Servo ");
SERIAL_PROTOCOL(servo_index); SERIAL_ECHO(servo_index);
SERIAL_PROTOCOL(": "); SERIAL_ECHO(": ");
SERIAL_PROTOCOL(servo[servo_index].read()); SERIAL_ECHOLN(servo[servo_index].read());
SERIAL_EOL;
} }
} }
@ -4812,27 +4811,27 @@ inline void gcode_M226() {
#endif #endif
updatePID(); updatePID();
SERIAL_PROTOCOL(MSG_OK); SERIAL_ECHO_START;
#if ENABLED(PID_PARAMS_PER_EXTRUDER) #if ENABLED(PID_PARAMS_PER_EXTRUDER)
SERIAL_PROTOCOL(" e:"); // specify extruder in serial output SERIAL_ECHO(" e:"); // specify extruder in serial output
SERIAL_PROTOCOL(e); SERIAL_ECHO(e);
#endif // PID_PARAMS_PER_EXTRUDER #endif // PID_PARAMS_PER_EXTRUDER
SERIAL_PROTOCOL(" p:"); SERIAL_ECHO(" p:");
SERIAL_PROTOCOL(PID_PARAM(Kp, e)); SERIAL_ECHO(PID_PARAM(Kp, e));
SERIAL_PROTOCOL(" i:"); SERIAL_ECHO(" i:");
SERIAL_PROTOCOL(unscalePID_i(PID_PARAM(Ki, e))); SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
SERIAL_PROTOCOL(" d:"); SERIAL_ECHO(" d:");
SERIAL_PROTOCOL(unscalePID_d(PID_PARAM(Kd, e))); SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
#if ENABLED(PID_ADD_EXTRUSION_RATE) #if ENABLED(PID_ADD_EXTRUSION_RATE)
SERIAL_PROTOCOL(" c:"); SERIAL_ECHO(" c:");
//Kc does not have scaling applied above, or in resetting defaults //Kc does not have scaling applied above, or in resetting defaults
SERIAL_PROTOCOL(PID_PARAM(Kc, e)); SERIAL_ECHO(PID_PARAM(Kc, e));
#endif #endif
SERIAL_EOL; SERIAL_EOL;
} }
else { else {
SERIAL_ECHO_START; SERIAL_ERROR_START;
SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); SERIAL_ERRORLN(MSG_INVALID_EXTRUDER);
} }
} }
@ -4846,14 +4845,13 @@ inline void gcode_M226() {
if (code_seen('D')) bedKd = scalePID_d(code_value()); if (code_seen('D')) bedKd = scalePID_d(code_value());
updatePID(); updatePID();
SERIAL_PROTOCOL(MSG_OK); SERIAL_ECHO_START;
SERIAL_PROTOCOL(" p:"); SERIAL_ECHO(" p:");
SERIAL_PROTOCOL(bedKp); SERIAL_ECHO(bedKp);
SERIAL_PROTOCOL(" i:"); SERIAL_ECHO(" i:");
SERIAL_PROTOCOL(unscalePID_i(bedKi)); SERIAL_ECHO(unscalePID_i(bedKi));
SERIAL_PROTOCOL(" d:"); SERIAL_ECHO(" d:");
SERIAL_PROTOCOL(unscalePID_d(bedKd)); SERIAL_ECHOLN(unscalePID_d(bedKd));
SERIAL_EOL;
} }
#endif // PIDTEMPBED #endif // PIDTEMPBED
@ -5285,7 +5283,7 @@ inline void gcode_M503() {
float value = code_value(); float value = code_value();
if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) { if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) {
zprobe_zoffset = value; zprobe_zoffset = value;
SERIAL_ECHOPGM(MSG_OK); SERIAL_ECHO(zprobe_zoffset);
} }
else { else {
SERIAL_ECHOPGM(MSG_Z_MIN); SERIAL_ECHOPGM(MSG_Z_MIN);

Loading…
Cancel
Save