From ad480bd4703b625b800cf5f822be8f73a95d67ee Mon Sep 17 00:00:00 2001
From: Kevin O'Connor <kevin@koconnor.net>
Date: Sun, 26 Aug 2018 11:06:20 -0400
Subject: [PATCH] mcu: Avoid adding the same stepper multiple times to an
 endstop

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
---
 klippy/mcu.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/klippy/mcu.py b/klippy/mcu.py
index 3e29d630c..5060dbeb7 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)