diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-06-21 12:28:58 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-06-21 12:53:47 -0400 |
commit | f6e9db2d05e5550180ae394d2da519d37740e780 (patch) | |
tree | 6dc90abc9e91f275379c4adc24abc181208b1581 /klippy | |
parent | 98915fb1d030f15d6f88af32d81724d334330860 (diff) | |
download | kutter-f6e9db2d05e5550180ae394d2da519d37740e780.tar.gz kutter-f6e9db2d05e5550180ae394d2da519d37740e780.tar.xz kutter-f6e9db2d05e5550180ae394d2da519d37740e780.zip |
toolhead: Just warn if M204 doesn't contain valid S, P, or T
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/toolhead.py | 10 |
1 files changed, 7 insertions, 3 deletions
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() |