aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/fan.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-03-12 22:43:05 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-03-13 00:38:17 -0400
commitd21b9280f029f1c65d3dac9310eb00090dd8c531 (patch)
treecc3b34c2ecc0b277470dfe567a40b144cb7c3174 /klippy/fan.py
parent92649332ce1f4ad7445f5e97ee6d24c79eccece9 (diff)
downloadkutter-d21b9280f029f1c65d3dac9310eb00090dd8c531.tar.gz
kutter-d21b9280f029f1c65d3dac9310eb00090dd8c531.tar.xz
kutter-d21b9280f029f1c65d3dac9310eb00090dd8c531.zip
klippy: Eliminate high-level build_config phase
Now that the mcu objects can be created prior to connecting to the mcu, it is no longer necessary to separate the init and build_config phases in the high-level code. Move the mcu objection creation from the build_config phase to the init phase and eliminate the build_config phase. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/fan.py')
-rw-r--r--klippy/fan.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/klippy/fan.py b/klippy/fan.py
index 2f9fb7a5..78767b02 100644
--- a/klippy/fan.py
+++ b/klippy/fan.py
@@ -9,17 +9,12 @@ PWM_CYCLE_TIME = 0.010
class PrinterFan:
def __init__(self, printer, config):
- self.printer = printer
- self.config = config
- self.mcu_fan = None
self.last_fan_value = 0.
self.last_fan_time = 0.
self.kick_start_time = config.getfloat('kick_start_time', 0.1)
- def build_config(self):
- pin = self.config.get('pin')
- hard_pwm = self.config.getint('hard_pwm', 0)
- self.mcu_fan = self.printer.mcu.create_pwm(
- pin, PWM_CYCLE_TIME, hard_pwm, 0.)
+ pin = config.get('pin')
+ hard_pwm = config.getint('hard_pwm', 0)
+ self.mcu_fan = printer.mcu.create_pwm(pin, PWM_CYCLE_TIME, hard_pwm, 0.)
# External commands
def set_speed(self, print_time, value):
value = max(0., min(1., value))