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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-02-23 12:00:08 -05:00
parent 4d2adddb20
commit a8742e982d
1 changed files with 2 additions and 1 deletions

View File

@ -266,7 +266,8 @@ class TMCMicrostepHelper:
self.fields = mcu_tmc.get_fields() self.fields = mcu_tmc.get_fields()
stepper_name = " ".join(config.get_name().split()[1:]) stepper_name = " ".join(config.get_name().split()[1:])
stepper_config = ms_config = config.getsection(stepper_name) 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 # Older config format with microsteps in tmc config section
ms_config = config ms_config = config
steps = {'256': 0, '128': 1, '64': 2, '32': 3, '16': 4, steps = {'256': 0, '128': 1, '64': 2, '32': 3, '16': 4,