stepper: Fix bug causing 'enable_pin' to be required

Make sure to initialize mcu_enable to None so that it is initialized
if no 'enable_pin' config value is provided.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-09-19 15:33:34 -04:00
parent 14810d7e80
commit 123719bf92
1 changed files with 1 additions and 0 deletions

View File

@ -21,6 +21,7 @@ class PrinterStepper:
self.mcu_stepper.setup_step_distance(self.step_dist)
enable_pin = config.get('enable_pin', None)
self.mcu_enable = None
if enable_pin is not None:
self.mcu_enable = pins.setup_pin(printer, 'digital_out', enable_pin)
self.mcu_enable.setup_max_duration(0.)