diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2024-05-16 12:23:48 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-05-16 12:29:52 -0400 |
commit | 5d52b32e645d71f8e6b8b5426f89fe61eaf92e56 (patch) | |
tree | c918ada1c67010050ac770f89abfccbcd841a6c5 | |
parent | 2efde0111e949c87f72409fbe43a6a96d5aa07f5 (diff) | |
download | kutter-5d52b32e645d71f8e6b8b5426f89fe61eaf92e56.tar.gz kutter-5d52b32e645d71f8e6b8b5426f89fe61eaf92e56.tar.xz kutter-5d52b32e645d71f8e6b8b5426f89fe61eaf92e56.zip |
tmc: Remove code that could read microsteps in tmc config sections
Setting of microsteps in the stepper config section has been required
since commit eea0137b. Remove the no longer needed compatibility
code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | klippy/extras/tmc.py | 10 | ||||
-rw-r--r-- | klippy/stepper.py | 3 |
2 files changed, 5 insertions, 8 deletions
diff --git a/klippy/extras/tmc.py b/klippy/extras/tmc.py index a797b866..1d8599e2 100644 --- a/klippy/extras/tmc.py +++ b/klippy/extras/tmc.py @@ -577,7 +577,7 @@ def TMCWaveTableHelper(config, mcu_tmc): set_config_field(config, "start_sin", 0) set_config_field(config, "start_sin90", 247) -# Helper to configure and query the microstep settings +# Helper to configure the microstep settings def TMCMicrostepHelper(config, mcu_tmc): fields = mcu_tmc.get_fields() stepper_name = " ".join(config.get_name().split()[1:]) @@ -585,13 +585,9 @@ def TMCMicrostepHelper(config, mcu_tmc): raise config.error( "Could not find config section '[%s]' required by tmc driver" % (stepper_name,)) - stepper_config = ms_config = config.getsection(stepper_name) - 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 + sconfig = config.getsection(stepper_name) steps = {256: 0, 128: 1, 64: 2, 32: 3, 16: 4, 8: 5, 4: 6, 2: 7, 1: 8} - mres = ms_config.getchoice('microsteps', steps) + mres = sconfig.getchoice('microsteps', steps) fields.set_field("mres", mres) fields.set_field("intpol", config.getboolean("interpolate", True)) diff --git a/klippy/stepper.py b/klippy/stepper.py index 56c8ec75..9b692904 100644 --- a/klippy/stepper.py +++ b/klippy/stepper.py @@ -265,6 +265,7 @@ def parse_gear_ratio(config, note_valid): # Obtain "step distance" information from a config section def parse_step_distance(config, units_in_radians=None, note_valid=False): + # Check rotation_distance and gear_ratio if units_in_radians is None: # Caller doesn't know if units are in radians - infer it rd = config.get('rotation_distance', None, note_valid=False) @@ -276,7 +277,7 @@ def parse_step_distance(config, units_in_radians=None, note_valid=False): else: rotation_dist = config.getfloat('rotation_distance', above=0., note_valid=note_valid) - # Newer config format with rotation_distance + # Check microsteps and full_steps_per_rotation microsteps = config.getint('microsteps', minval=1, note_valid=note_valid) full_steps = config.getint('full_steps_per_rotation', 200, minval=1, note_valid=note_valid) |