mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 23:24:01 -06:00
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>
This commit is contained in:
parent
a4439b93b7
commit
4eeb43b191
9 changed files with 36 additions and 44 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue