diff --git a/cfg/uniax_cfg.py b/cfg/uniax_cfg.py index 927ad90f..a7c703e1 100644 --- a/cfg/uniax_cfg.py +++ b/cfg/uniax_cfg.py @@ -24,6 +24,7 @@ Mod('drv', encoder_tolerance=3.6, free_wheeling=0.1, power_down_delay=0.1, + has_limit_switches=False, ) Mod('transducer', diff --git a/frappy_psi/trinamic.py b/frappy_psi/trinamic.py index 0a63161d..1d5a1adf 100644 --- a/frappy_psi/trinamic.py +++ b/frappy_psi/trinamic.py @@ -159,7 +159,7 @@ class Motor(PersistentMixin, HasIO, Drivable): has_home = Parameter('enable home and activate pullup resistor', BoolType(), export=True, default=False, group='more') has_limit_switches = Parameter('enable limit switches and activate pullup resistor', - BoolType(), default=False, group='motorparam') + BoolType(), value=False, readonly=False, group='motorparam') disable_right_switch = writable('disable right limit switch', BoolType(), group='motorparam') disable_left_switch = writable('disable left limit switch', BoolType(), group='motorparam') has_inputs = Parameter('inputs are polled', BoolType(), group='more', default=False) @@ -505,10 +505,14 @@ class Motor(PersistentMixin, HasIO, Drivable): self.write_pullup_inputs(True) def write_has_limit_switches(self, value): - self.has_inputs = True - self.write_pullup_inputs(True) - self.write_disable_left_switch(False) - self.write_disable_right_switch(False) + if value: + self.has_inputs = True + self.write_pullup_inputs(True) + self.write_disable_left_switch(False) + self.write_disable_right_switch(False) + else: + self.write_disable_left_switch(True) + self.write_disable_right_switch(True) @Command(FloatRange()) def set_zero(self, value):