diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2022-03-04 13:32:18 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2022-03-04 13:38:59 -0500 |
commit | fe2974b8ec1e41c16e8b37551443c1a7ea6717a5 (patch) | |
tree | f34c626f9fcc0902408f84ddf6197668c40938a5 /klippy/kinematics | |
parent | 4815a946c2861408475a15986d021d694908f728 (diff) | |
download | kutter-fe2974b8ec1e41c16e8b37551443c1a7ea6717a5.tar.gz kutter-fe2974b8ec1e41c16e8b37551443c1a7ea6717a5.tar.xz kutter-fe2974b8ec1e41c16e8b37551443c1a7ea6717a5.zip |
extruder: Verify trapq is unmodified on default SET_PRESSURE_ADVANCE
Check that a SET_PRESSURE_ADVANCE without an explicit EXTRUDER
parameter isn't done after the user disables or reassociates the
extruder stepper motor (via SYNC_EXTRUDER_MOTION). Otherwise, it
could lead to very confusing results.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/kinematics')
-rw-r--r-- | klippy/kinematics/extruder.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/klippy/kinematics/extruder.py b/klippy/kinematics/extruder.py index e3303982..76f9c35e 100644 --- a/klippy/kinematics/extruder.py +++ b/klippy/kinematics/extruder.py @@ -81,6 +81,9 @@ class ExtruderStepper: extruder = self.printer.lookup_object('toolhead').get_extruder() if extruder.extruder_stepper is None: raise gcmd.error("Active extruder does not have a stepper") + strapq = extruder.extruder_stepper.stepper.get_trapq() + if strapq is not extruder.get_trapq(): + raise gcmd.error("Unable to infer active extruder stepper") extruder.extruder_stepper.cmd_SET_PRESSURE_ADVANCE(gcmd) def cmd_SET_PRESSURE_ADVANCE(self, gcmd): pressure_advance = gcmd.get_float('ADVANCE', self.pressure_advance, |