diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-08-29 17:20:26 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-08-29 17:59:27 -0400 |
commit | 68d6788413ea8408d3c0290f4e6aa9974733a324 (patch) | |
tree | 02111f4a58166a6175b71e453b5dbfacf52c9661 /klippy/fan.py | |
parent | c7c551369f38eb3de73516ec9239a1014377a397 (diff) | |
download | kutter-68d6788413ea8408d3c0290f4e6aa9974733a324.tar.gz kutter-68d6788413ea8408d3c0290f4e6aa9974733a324.tar.xz kutter-68d6788413ea8408d3c0290f4e6aa9974733a324.zip |
mcu: Add get_mcu() call to the mcu oid objects
Allow external code to obtain the mcu object that controls a pin setup
with setup_pin(). Also, don't bother defining print_to_mcu_time() and
system_to_mcu_time() on each pin object as they can be obtained via
the new get_mcu() method.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/fan.py')
-rw-r--r-- | klippy/fan.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/klippy/fan.py b/klippy/fan.py index a46dc24e..05e883a5 100644 --- a/klippy/fan.py +++ b/klippy/fan.py @@ -33,7 +33,7 @@ class PrinterFan: self.last_fan_value = value # External commands def set_speed(self, print_time, value): - mcu_time = self.mcu_fan.print_to_mcu_time(print_time) + mcu_time = self.mcu_fan.get_mcu().print_to_mcu_time(print_time) self.set_pwm(mcu_time, value) class PrinterHeaterFan: @@ -53,7 +53,8 @@ class PrinterHeaterFan: power = 0. if target_temp or current_temp > self.heater_temp: power = 1. - mcu_time = self.fan.mcu_fan.system_to_mcu_time(eventtime + FAN_MIN_TIME) + mcu_time = self.fan.mcu_fan.get_mcu().system_to_mcu_time( + eventtime + FAN_MIN_TIME) self.fan.set_pwm(mcu_time, power) return eventtime + 1. |