aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/mcu.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-08-26 11:06:20 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-08-26 23:06:32 -0400
commitad480bd4703b625b800cf5f822be8f73a95d67ee (patch)
treec21b6a6887bb76f95ed196a565c2c170bd01295a /klippy/mcu.py
parent96acfdc6d2e4130e3d5c690a6fe523f8469c417c (diff)
downloadkutter-ad480bd4703b625b800cf5f822be8f73a95d67ee.tar.gz
kutter-ad480bd4703b625b800cf5f822be8f73a95d67ee.tar.xz
kutter-ad480bd4703b625b800cf5f822be8f73a95d67ee.zip
mcu: Avoid adding the same stepper multiple times to an endstop
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r--klippy/mcu.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py
index 3e29d630..5060dbeb 100644
--- a/klippy/mcu.py
+++ b/klippy/mcu.py
@@ -150,6 +150,8 @@ class MCU_endstop:
def add_stepper(self, stepper):
if stepper.get_mcu() is not self._mcu:
raise pins.error("Endstop and stepper must be on the same mcu")
+ if stepper in self._steppers:
+ return
self._steppers.append(stepper)
def get_steppers(self):
return list(self._steppers)