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/ad5206.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'klippy/extras/ad5206.py') diff --git a/klippy/extras/ad5206.py b/klippy/extras/ad5206.py index 780fb479..e5bc96d3 100644 --- a/klippy/extras/ad5206.py +++ b/klippy/extras/ad5206.py @@ -3,15 +3,14 @@ # Copyright (C) 2017,2018 Kevin O'Connor # # This file may be distributed under the terms of the GNU GPLv3 license. -import pins class ad5206: def __init__(self, config): - printer = config.get_printer() - enable_pin_params = pins.get_printer_pins(printer).lookup_pin( - 'digital_out', config.get('enable_pin')) + ppins = config.get_printer().lookup_object('pins') + enable_pin = config.get('enable_pin') + enable_pin_params = ppins.lookup_pin('digital_out', enable_pin) if enable_pin_params['invert']: - raise pins.error("ad5206 can not invert pin") + raise ppins.error("ad5206 can not invert pin") self.mcu = enable_pin_params['chip'] self.pin = enable_pin_params['pin'] self.mcu.add_config_object(self) -- cgit v1.2.3-70-g09d2