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.
pull/1/head
Sebastianv650 7 years ago
committed by Scott Lahteine
parent
commit
fd1d590726
  1. 22
      Marlin/src/gcode/config/M200-M205.cpp

22
Marlin/src/gcode/config/M200-M205.cpp

@ -91,21 +91,27 @@ void GcodeSuite::M203() {
* T = Travel (non printing) moves
*/
void GcodeSuite::M204() {
if (parser.seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments.
bool report = true;
if (parser.seenval('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments.
planner.travel_acceleration = planner.acceleration = parser.value_linear_units();
SERIAL_ECHOLNPAIR("Setting Print and Travel Acceleration: ", planner.acceleration);
report = false;
}
if (parser.seen('P')) {
if (parser.seenval('P')) {
planner.acceleration = parser.value_linear_units();
SERIAL_ECHOLNPAIR("Setting Print Acceleration: ", planner.acceleration);
report = false;
}
if (parser.seen('R')) {
if (parser.seenval('R')) {
planner.retract_acceleration = parser.value_linear_units();
SERIAL_ECHOLNPAIR("Setting Retract Acceleration: ", planner.retract_acceleration);
report = false;
}
if (parser.seen('T')) {
if (parser.seenval('T')) {
planner.travel_acceleration = parser.value_linear_units();
SERIAL_ECHOLNPAIR("Setting Travel Acceleration: ", planner.travel_acceleration);
report = false;
}
if (report) {
SERIAL_ECHOPAIR("Acceleration: P", planner.acceleration);
SERIAL_ECHOPAIR(" R", planner.retract_acceleration);
SERIAL_ECHOLNPAIR(" T", planner.travel_acceleration);
}
}

Loading…
Cancel
Save