aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/ad5206.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-04-04 12:07:41 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-04-04 12:26:39 -0400
commit4eeb43b191e3d928cf817d3be0350711dc05526d (patch)
treeff125436b053e70aac5c0f8ce3a668f90dde6fc5 /klippy/extras/ad5206.py
parenta4439b93b79395cbc1cf5d39f856701922dfdd84 (diff)
downloadkutter-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/extras/ad5206.py')
-rw-r--r--klippy/extras/ad5206.py9
1 files changed, 4 insertions, 5 deletions
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 <kevin@koconnor.net>
#
# 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)