toolhead: Just warn if M204 doesn't contain valid S, P, or T
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
98915fb1d0
commit
f6e9db2d05
|
@ -467,13 +467,17 @@ class ToolHead:
|
||||||
gcode.respond_info(msg, log=False)
|
gcode.respond_info(msg, log=False)
|
||||||
def cmd_M204(self, params):
|
def cmd_M204(self, params):
|
||||||
gcode = self.printer.lookup_object('gcode')
|
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
|
# Use minimum of P and T for accel
|
||||||
accel = min(gcode.get_float('P', params, above=0.),
|
accel = min(gcode.get_float('P', params, above=0.),
|
||||||
gcode.get_float('T', params, above=0.))
|
gcode.get_float('T', params, above=0.))
|
||||||
else:
|
else:
|
||||||
# Use S for accel
|
gcode.respond_info('Invalid M204 command "%s"'
|
||||||
accel = gcode.get_float('S', params, above=0.)
|
% (params['#original'],))
|
||||||
|
return
|
||||||
self.max_accel = min(accel, self.config_max_accel)
|
self.max_accel = min(accel, self.config_max_accel)
|
||||||
self._calc_junction_deviation()
|
self._calc_junction_deviation()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue