Browse Source

[2.0.x] Silence M204 (#10037)

`M204` is often used by slicers to set acceleration depending on perimeter, infill, etc., so Marlin's answers are flooding the serial windows. Silence `M204` according to the philosophy that setter commands should only send a reply if no parameter is given.
Sebastianv650 7 years ago
parent
commit
fd1d590726
1 changed files with 14 additions and 8 deletions
  1. 14
    8
      Marlin/src/gcode/config/M200-M205.cpp

+ 14
- 8
Marlin/src/gcode/config/M200-M205.cpp View File

@@ -91,21 +91,27 @@ void GcodeSuite::M203() {
91 91
  *    T = Travel (non printing) moves
92 92
  */
93 93
 void GcodeSuite::M204() {
94
-  if (parser.seen('S')) {  // Kept for legacy compatibility. Should NOT BE USED for new developments.
94
+  bool report = true;
95
+  if (parser.seenval('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments.
95 96
     planner.travel_acceleration = planner.acceleration = parser.value_linear_units();
96
-    SERIAL_ECHOLNPAIR("Setting Print and Travel Acceleration: ", planner.acceleration);
97
+    report = false;
97 98
   }
98
-  if (parser.seen('P')) {
99
+  if (parser.seenval('P')) {
99 100
     planner.acceleration = parser.value_linear_units();
100
-    SERIAL_ECHOLNPAIR("Setting Print Acceleration: ", planner.acceleration);
101
+    report = false;
101 102
   }
102
-  if (parser.seen('R')) {
103
+  if (parser.seenval('R')) {
103 104
     planner.retract_acceleration = parser.value_linear_units();
104
-    SERIAL_ECHOLNPAIR("Setting Retract Acceleration: ", planner.retract_acceleration);
105
+    report = false;
105 106
   }
106
-  if (parser.seen('T')) {
107
+  if (parser.seenval('T')) {
107 108
     planner.travel_acceleration = parser.value_linear_units();
108
-    SERIAL_ECHOLNPAIR("Setting Travel Acceleration: ", planner.travel_acceleration);
109
+    report = false;
110
+  }
111
+  if (report) {
112
+    SERIAL_ECHOPAIR("Acceleration: P", planner.acceleration);
113
+    SERIAL_ECHOPAIR(" R", planner.retract_acceleration);
114
+    SERIAL_ECHOLNPAIR(" T", planner.travel_acceleration);
109 115
   }
110 116
 }
111 117
 

Loading…
Cancel
Save