From 4eeb43b191e3d928cf817d3be0350711dc05526d Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 4 Apr 2018 12:07:41 -0400 Subject: pins: Remove module level get_printer_pins() and setup_pin() functions Most callers did a lookup of the pins module via printer.lookup_object("pins"). Use that as the standard method and remove these less frequently used methods. Signed-off-by: Kevin O'Connor --- klippy/extras/fan.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'klippy/extras/fan.py') diff --git a/klippy/extras/fan.py b/klippy/extras/fan.py index 86572971..929ad172 100644 --- a/klippy/extras/fan.py +++ b/klippy/extras/fan.py @@ -3,7 +3,6 @@ # Copyright (C) 2016-2018 Kevin O'Connor # # This file may be distributed under the terms of the GNU GPLv3 license. -import pins FAN_MIN_TIME = 0.100 @@ -13,8 +12,8 @@ class PrinterFan: self.last_fan_time = 0. self.max_power = config.getfloat('max_power', 1., above=0., maxval=1.) self.kick_start_time = config.getfloat('kick_start_time', 0.1, minval=0.) - printer = config.get_printer() - self.mcu_fan = pins.setup_pin(printer, 'pwm', config.get('pin')) + ppins = config.get_printer().lookup_object('pins') + self.mcu_fan = ppins.setup_pin('pwm', config.get('pin')) self.mcu_fan.setup_max_duration(0.) cycle_time = config.getfloat('cycle_time', 0.010, above=0.) hardware_pwm = config.getboolean('hardware_pwm', False) -- cgit v1.2.3-70-g09d2