From a8742e982d899e75f9ffcd3992878b401223ed9e Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 23 Feb 2021 12:00:08 -0500 Subject: [PATCH] tmc: Improve error message on missing microsteps config If microsteps is missing, warn about it in the stepper config section, not the tmc config section. Signed-off-by: Kevin O'Connor --- klippy/extras/tmc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/klippy/extras/tmc.py b/klippy/extras/tmc.py index 4d3296aa..fbd9f584 100644 --- a/klippy/extras/tmc.py +++ b/klippy/extras/tmc.py @@ -266,7 +266,8 @@ class TMCMicrostepHelper: self.fields = mcu_tmc.get_fields() stepper_name = " ".join(config.get_name().split()[1:]) stepper_config = ms_config = config.getsection(stepper_name) - if stepper_config.get('microsteps', None, note_valid=False) is None: + if (stepper_config.get('microsteps', None, note_valid=False) is None + and config.get('microsteps', None, note_valid=False) is not None): # Older config format with microsteps in tmc config section ms_config = config steps = {'256': 0, '128': 1, '64': 2, '32': 3, '16': 4,