mcu: Remove unneeded MCU_digital_out.get_last_setting() method

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-12-05 21:09:06 -05:00
parent 2a8dd5c51f
commit 1d6af72de5
3 changed files with 1 additions and 9 deletions

View File

@ -208,7 +208,6 @@ class ReplicapeDACEnable:
self.mcu = replicape.host_mcu self.mcu = replicape.host_mcu
self.value = replicape.stepper_dacs[channel] self.value = replicape.stepper_dacs[channel]
self.pwm = pca9685_pwm(replicape, channel, pin_params) self.pwm = pca9685_pwm(replicape, channel, pin_params)
self.last = 0
def get_mcu(self): def get_mcu(self):
return self.mcu return self.mcu
def setup_max_duration(self, max_duration): def setup_max_duration(self, max_duration):
@ -218,9 +217,6 @@ class ReplicapeDACEnable:
self.pwm.set_pwm(print_time, self.value) self.pwm.set_pwm(print_time, self.value)
else: else:
self.pwm.set_pwm(print_time, 0.) self.pwm.set_pwm(print_time, 0.)
self.last = value
def get_last_setting(self):
return self.last
ReplicapeStepConfig = { ReplicapeStepConfig = {
'disable': None, 'disable': None,

View File

@ -233,7 +233,6 @@ class MCU_digital_out:
self._invert = self._shutdown_value = pin_params['invert'] self._invert = self._shutdown_value = pin_params['invert']
self._max_duration = 2. self._max_duration = 2.
self._last_clock = 0 self._last_clock = 0
self._last_value = None
self._cmd_queue = mcu.alloc_command_queue() self._cmd_queue = mcu.alloc_command_queue()
self._set_cmd = None self._set_cmd = None
def get_mcu(self): def get_mcu(self):
@ -264,9 +263,6 @@ class MCU_digital_out:
self._mcu.send(msg, minclock=self._last_clock, reqclock=clock self._mcu.send(msg, minclock=self._last_clock, reqclock=clock
, cq=self._cmd_queue) , cq=self._cmd_queue)
self._last_clock = clock self._last_clock = clock
self._last_value = value
def get_last_setting(self):
return self._last_value
def set_pwm(self, print_time, value): def set_pwm(self, print_time, value):
self.set_digital(print_time, value >= 0.5) self.set_digital(print_time, value >= 0.5)

View File

@ -45,7 +45,7 @@ class PrinterStepper:
self.mcu_stepper.set_position(pos) self.mcu_stepper.set_position(pos)
def motor_enable(self, print_time, enable=0): def motor_enable(self, print_time, enable=0):
if (self.mcu_enable is not None if (self.mcu_enable is not None
and self.mcu_enable.get_last_setting() != enable): and self.need_motor_enable != (not enable)):
self.mcu_enable.set_digital(print_time, enable) self.mcu_enable.set_digital(print_time, enable)
self.need_motor_enable = not enable self.need_motor_enable = not enable