瀏覽代碼

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.
AnHardt 9 年之前
父節點
當前提交
efbd705eda
共有 1 個檔案被更改,包括 30 行新增32 行删除
  1. 30
    32
      Marlin/Marlin_main.cpp

+ 30
- 32
Marlin/Marlin_main.cpp 查看文件

@@ -4749,19 +4749,18 @@ inline void gcode_M226() {
4749 4749
       if (servo_index >= 0 && servo_index < NUM_SERVOS)
4750 4750
         servo[servo_index].move(servo_position);
4751 4751
       else {
4752
-        SERIAL_ECHO_START;
4753
-        SERIAL_ECHO("Servo ");
4754
-        SERIAL_ECHO(servo_index);
4755
-        SERIAL_ECHOLN(" out of range");
4752
+        SERIAL_ERROR_START;
4753
+        SERIAL_ERROR("Servo ");
4754
+        SERIAL_ERROR(servo_index);
4755
+        SERIAL_ERRORLN(" out of range");
4756 4756
       }
4757 4757
     }
4758 4758
     else if (servo_index >= 0) {
4759
-      SERIAL_PROTOCOL(MSG_OK);
4760
-      SERIAL_PROTOCOL(" Servo ");
4761
-      SERIAL_PROTOCOL(servo_index);
4762
-      SERIAL_PROTOCOL(": ");
4763
-      SERIAL_PROTOCOL(servo[servo_index].read());
4764
-      SERIAL_EOL;
4759
+      SERIAL_ECHO_START;
4760
+      SERIAL_ECHO(" Servo ");
4761
+      SERIAL_ECHO(servo_index);
4762
+      SERIAL_ECHO(": ");
4763
+      SERIAL_ECHOLN(servo[servo_index].read());
4765 4764
     }
4766 4765
   }
4767 4766
 
@@ -4812,27 +4811,27 @@ inline void gcode_M226() {
4812 4811
       #endif
4813 4812
 
4814 4813
       updatePID();
4815
-      SERIAL_PROTOCOL(MSG_OK);
4814
+      SERIAL_ECHO_START;
4816 4815
       #if ENABLED(PID_PARAMS_PER_EXTRUDER)
4817
-        SERIAL_PROTOCOL(" e:"); // specify extruder in serial output
4818
-        SERIAL_PROTOCOL(e);
4816
+        SERIAL_ECHO(" e:"); // specify extruder in serial output
4817
+        SERIAL_ECHO(e);
4819 4818
       #endif // PID_PARAMS_PER_EXTRUDER
4820
-      SERIAL_PROTOCOL(" p:");
4821
-      SERIAL_PROTOCOL(PID_PARAM(Kp, e));
4822
-      SERIAL_PROTOCOL(" i:");
4823
-      SERIAL_PROTOCOL(unscalePID_i(PID_PARAM(Ki, e)));
4824
-      SERIAL_PROTOCOL(" d:");
4825
-      SERIAL_PROTOCOL(unscalePID_d(PID_PARAM(Kd, e)));
4819
+      SERIAL_ECHO(" p:");
4820
+      SERIAL_ECHO(PID_PARAM(Kp, e));
4821
+      SERIAL_ECHO(" i:");
4822
+      SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
4823
+      SERIAL_ECHO(" d:");
4824
+      SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
4826 4825
       #if ENABLED(PID_ADD_EXTRUSION_RATE)
4827
-        SERIAL_PROTOCOL(" c:");
4826
+        SERIAL_ECHO(" c:");
4828 4827
         //Kc does not have scaling applied above, or in resetting defaults
4829
-        SERIAL_PROTOCOL(PID_PARAM(Kc, e));
4828
+        SERIAL_ECHO(PID_PARAM(Kc, e));
4830 4829
       #endif
4831 4830
       SERIAL_EOL;
4832 4831
     }
4833 4832
     else {
4834
-      SERIAL_ECHO_START;
4835
-      SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
4833
+      SERIAL_ERROR_START;
4834
+      SERIAL_ERRORLN(MSG_INVALID_EXTRUDER);
4836 4835
     }
4837 4836
   }
4838 4837
 
@@ -4846,14 +4845,13 @@ inline void gcode_M226() {
4846 4845
     if (code_seen('D')) bedKd = scalePID_d(code_value());
4847 4846
 
4848 4847
     updatePID();
4849
-    SERIAL_PROTOCOL(MSG_OK);
4850
-    SERIAL_PROTOCOL(" p:");
4851
-    SERIAL_PROTOCOL(bedKp);
4852
-    SERIAL_PROTOCOL(" i:");
4853
-    SERIAL_PROTOCOL(unscalePID_i(bedKi));
4854
-    SERIAL_PROTOCOL(" d:");
4855
-    SERIAL_PROTOCOL(unscalePID_d(bedKd));
4856
-    SERIAL_EOL;
4848
+    SERIAL_ECHO_START;
4849
+    SERIAL_ECHO(" p:");
4850
+    SERIAL_ECHO(bedKp);
4851
+    SERIAL_ECHO(" i:");
4852
+    SERIAL_ECHO(unscalePID_i(bedKi));
4853
+    SERIAL_ECHO(" d:");
4854
+    SERIAL_ECHOLN(unscalePID_d(bedKd));
4857 4855
   }
4858 4856
 
4859 4857
 #endif // PIDTEMPBED
@@ -5285,7 +5283,7 @@ inline void gcode_M503() {
5285 5283
       float value = code_value();
5286 5284
       if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) {
5287 5285
         zprobe_zoffset = value;
5288
-        SERIAL_ECHOPGM(MSG_OK);
5286
+        SERIAL_ECHO(zprobe_zoffset);
5289 5287
       }
5290 5288
       else {
5291 5289
         SERIAL_ECHOPGM(MSG_Z_MIN);

Loading…
取消
儲存