mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-10-26 07:46:11 +01:00
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>
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user