From e78377eebd819270d5bc31cde58c60af6435f714 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 12 Mar 2018 18:32:29 -0400 Subject: [PATCH] replicape: Add config controls for the servo[01]_enable lines Signed-off-by: Kevin O'Connor --- config/generic-replicape.cfg | 6 ++++++ klippy/extras/replicape.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/config/generic-replicape.cfg b/config/generic-replicape.cfg index 85375907..d36f9eb7 100644 --- a/config/generic-replicape.cfg +++ b/config/generic-replicape.cfg @@ -38,6 +38,12 @@ host_mcu: host # This parameter controls the CFG6_ENN line on all stepper # motors. True sets the enable lines to "open". The default is # False. +#servo0_enable: False +# This parameter controls whether end_stop_X_2 is used for endstops +# (via P9_11) or for servo_0 (via P9_14). The default is False. +#servo1_enable: False +# This parameter controls whether end_stop_Y_2 is used for endstops +# (via P9_28) or for servo_1 (via P9_16). The default is False. stepper_x_microstep_mode: spread16 # This parameter controls the CFG1 and CFG2 pins of the given # stepper motor driver. Available options are: disable, 1, 2, diff --git a/klippy/extras/replicape.py b/klippy/extras/replicape.py index 320a5701..33683585 100644 --- a/klippy/extras/replicape.py +++ b/klippy/extras/replicape.py @@ -160,6 +160,10 @@ class Replicape: self.stepper_dacs[channel] = cur / REPLICAPE_MAX_CURRENT self.pins[prefix + 'enable'] = (ReplicapeDACEnable, channel) self.enabled_channels = {ch: False for cl, ch in self.pins.values()} + if config.getboolean('servo0_enable', False): + shift_registers[1] |= 1 + if config.getboolean('servo1_enable', False): + shift_registers[2] |= 1 self.sr_disabled = tuple(reversed(shift_registers)) if [i for i in [0, 1, 2] if 11+i in self.stepper_dacs]: # Enable xyz steppers