From b8f1b74abdb0ad6013c5121bf6d79088fbc28e25 Mon Sep 17 00:00:00 2001 From: Sebastianv650 Date: Sat, 10 Mar 2018 14:15:52 +0100 Subject: [PATCH] [1.1.x] Silence M204 (#10036) `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. --- Marlin/Marlin_main.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b3e0ff449..aef3d3f81 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -8863,21 +8863,27 @@ inline void gcode_M203() { * T = Travel (non printing) moves */ inline void gcode_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); } }