mcu: Make sure steppers added to an endstop are on the same mcu

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-12-05 17:51:54 -05:00
parent 7932de11a7
commit 31db4cc772
1 changed files with 2 additions and 0 deletions

View File

@ -147,6 +147,8 @@ class MCU_endstop:
def get_mcu(self):
return self._mcu
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")
self._steppers.append(stepper)
def build_config(self):
self._oid = self._mcu.create_oid()