replicape: Add config controls for the servo[01]_enable lines
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
451f7d5672
commit
e78377eebd
|
@ -38,6 +38,12 @@ host_mcu: host
|
||||||
# This parameter controls the CFG6_ENN line on all stepper
|
# This parameter controls the CFG6_ENN line on all stepper
|
||||||
# motors. True sets the enable lines to "open". The default is
|
# motors. True sets the enable lines to "open". The default is
|
||||||
# False.
|
# 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
|
stepper_x_microstep_mode: spread16
|
||||||
# This parameter controls the CFG1 and CFG2 pins of the given
|
# This parameter controls the CFG1 and CFG2 pins of the given
|
||||||
# stepper motor driver. Available options are: disable, 1, 2,
|
# stepper motor driver. Available options are: disable, 1, 2,
|
||||||
|
|
|
@ -160,6 +160,10 @@ class Replicape:
|
||||||
self.stepper_dacs[channel] = cur / REPLICAPE_MAX_CURRENT
|
self.stepper_dacs[channel] = cur / REPLICAPE_MAX_CURRENT
|
||||||
self.pins[prefix + 'enable'] = (ReplicapeDACEnable, channel)
|
self.pins[prefix + 'enable'] = (ReplicapeDACEnable, channel)
|
||||||
self.enabled_channels = {ch: False for cl, ch in self.pins.values()}
|
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))
|
self.sr_disabled = tuple(reversed(shift_registers))
|
||||||
if [i for i in [0, 1, 2] if 11+i in self.stepper_dacs]:
|
if [i for i in [0, 1, 2] if 11+i in self.stepper_dacs]:
|
||||||
# Enable xyz steppers
|
# Enable xyz steppers
|
||||||
|
|
Loading…
Reference in New Issue