diff --git a/klippy/toolhead.py b/klippy/toolhead.py index 64790130..ef9368fc 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -467,13 +467,17 @@ class ToolHead: gcode.respond_info(msg, log=False) def cmd_M204(self, params): gcode = self.printer.lookup_object('gcode') - if 'P' in params and 'T' in params and 'S' not in params: + if 'S' in params: + # Use S for accel + accel = gcode.get_float('S', params, above=0.) + elif 'P' in params and 'T' in params: # Use minimum of P and T for accel accel = min(gcode.get_float('P', params, above=0.), gcode.get_float('T', params, above=0.)) else: - # Use S for accel - accel = gcode.get_float('S', params, above=0.) + gcode.respond_info('Invalid M204 command "%s"' + % (params['#original'],)) + return self.max_accel = min(accel, self.config_max_accel) self._calc_junction_deviation()