From fe1b2f5124b36d511906d2cdce4c69413638f53f Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 19 Aug 2021 15:45:36 -0400 Subject: [PATCH] tmc_uart: Use config.getlist() for select_pins config option Signed-off-by: Kevin O'Connor --- klippy/extras/tmc_uart.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/klippy/extras/tmc_uart.py b/klippy/extras/tmc_uart.py index 85be0149..fe51303e 100644 --- a/klippy/extras/tmc_uart.py +++ b/klippy/extras/tmc_uart.py @@ -1,6 +1,6 @@ # Helper code for communicating with TMC stepper drivers via UART # -# Copyright (C) 2018-2019 Kevin O'Connor +# Copyright (C) 2018-2021 Kevin O'Connor # # This file may be distributed under the terms of the GNU GPLv3 license. import logging @@ -16,7 +16,7 @@ class MCU_analog_mux: self.cmd_queue = cmd_queue ppins = mcu.get_printer().lookup_object("pins") select_pin_params = [ppins.lookup_pin(spd, can_invert=True) - for spd in select_pins_desc.split(',')] + for spd in select_pins_desc] self.oids = [self.mcu.create_oid() for pp in select_pin_params] self.pins = [pp['pin'] for pp in select_pin_params] self.pin_values = tuple([-1 for pp in select_pin_params]) @@ -32,7 +32,7 @@ class MCU_analog_mux: def get_instance_id(self, select_pins_desc): ppins = self.mcu.get_printer().lookup_object("pins") select_pin_params = [ppins.parse_pin(spd, can_invert=True) - for spd in select_pins_desc.split(',')] + for spd in select_pins_desc] for pin_params in select_pin_params: if pin_params['chip'] != self.mcu: raise self.mcu.get_printer().config_error( @@ -188,8 +188,8 @@ class MCU_TMC_uart_bitbang: # Lookup a (possibly shared) tmc uart def lookup_tmc_uart_bitbang(config, max_addr): ppins = config.get_printer().lookup_object("pins") - rx_pin_params = ppins.lookup_pin( - config.get('uart_pin'), can_pullup=True, share_type="tmc_uart_rx") + rx_pin_params = ppins.lookup_pin(config.get('uart_pin'), can_pullup=True, + share_type="tmc_uart_rx") tx_pin_desc = config.get('tx_pin', None) if tx_pin_desc is None: tx_pin_params = rx_pin_params @@ -197,7 +197,7 @@ def lookup_tmc_uart_bitbang(config, max_addr): tx_pin_params = ppins.lookup_pin(tx_pin_desc, share_type="tmc_uart_tx") if rx_pin_params['chip'] is not tx_pin_params['chip']: raise ppins.error("TMC uart rx and tx pins must be on the same mcu") - select_pins_desc = config.get('select_pins', None) + select_pins_desc = config.getlist('select_pins', None) addr = config.getint('uart_address', 0, minval=0, maxval=max_addr) mcu_uart = rx_pin_params.get('class') if mcu_uart is None: