diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-04-04 12:07:41 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-04-04 12:26:39 -0400 |
commit | 4eeb43b191e3d928cf817d3be0350711dc05526d (patch) | |
tree | ff125436b053e70aac5c0f8ce3a668f90dde6fc5 /klippy/heater.py | |
parent | a4439b93b79395cbc1cf5d39f856701922dfdd84 (diff) | |
download | kutter-4eeb43b191e3d928cf817d3be0350711dc05526d.tar.gz kutter-4eeb43b191e3d928cf817d3be0350711dc05526d.tar.xz kutter-4eeb43b191e3d928cf817d3be0350711dc05526d.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/heater.py')
-rw-r--r-- | klippy/heater.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/klippy/heater.py b/klippy/heater.py index cac8f984..f3b22886 100644 --- a/klippy/heater.py +++ b/klippy/heater.py @@ -4,7 +4,6 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import math, logging, threading -import pins ###################################################################### @@ -124,15 +123,16 @@ class PrinterHeater: algos = {'watermark': ControlBangBang, 'pid': ControlPID} algo = config.getchoice('control', algos) heater_pin = config.get('heater_pin') + ppins = printer.lookup_object('pins') if algo is ControlBangBang and self.max_power == 1.: - self.mcu_pwm = pins.setup_pin(printer, 'digital_out', heater_pin) + self.mcu_pwm = ppins.setup_pin('digital_out', heater_pin) else: - self.mcu_pwm = pins.setup_pin(printer, 'pwm', heater_pin) + self.mcu_pwm = ppins.setup_pin('pwm', heater_pin) pwm_cycle_time = config.getfloat( 'pwm_cycle_time', 0.100, above=0., maxval=REPORT_TIME) self.mcu_pwm.setup_cycle_time(pwm_cycle_time) self.mcu_pwm.setup_max_duration(MAX_HEAT_TIME) - self.mcu_adc = pins.setup_pin(printer, 'adc', config.get('sensor_pin')) + self.mcu_adc = ppins.setup_pin('adc', config.get('sensor_pin')) adc_range = [self.sensor.calc_adc(self.min_temp), self.sensor.calc_adc(self.max_temp)] self.mcu_adc.setup_minmax(SAMPLE_TIME, SAMPLE_COUNT, |