tmc: Fix s2vs field formatters

Rename the field formatter text for tmc2208/tmc2209 and implement it also for tmc5160.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
This commit is contained in:
Alex Voinea 2023-03-04 10:11:22 +01:00 committed by KevinOConnor
parent b2178f49ec
commit e6307ca9fe
3 changed files with 7 additions and 3 deletions

View File

@ -544,7 +544,7 @@ hot. Typical solutions are to decrease the stepper motor current,
increase cooling on the stepper motor driver, and/or increase cooling increase cooling on the stepper motor driver, and/or increase cooling
on the stepper motor. on the stepper motor.
#### TMC reports error: `... ShortToGND` OR `LowSideShort` #### TMC reports error: `... ShortToGND` OR `ShortToSupply`
This indicates the driver has disabled itself because it detected very This indicates the driver has disabled itself because it detected very
high current passing through the driver. This may indicate a loose or high current passing through the driver. This may indicate a loose or

View File

@ -173,8 +173,8 @@ SignedFields = ["cur_a", "cur_b", "pwm_scale_auto"]
FieldFormatters = dict(tmc2130.FieldFormatters) FieldFormatters = dict(tmc2130.FieldFormatters)
FieldFormatters.update({ FieldFormatters.update({
"sel_a": (lambda v: "%d(%s)" % (v, ["TMC222x", "TMC220x"][v])), "sel_a": (lambda v: "%d(%s)" % (v, ["TMC222x", "TMC220x"][v])),
"s2vsa": (lambda v: "1(LowSideShort_A!)" if v else ""), "s2vsa": (lambda v: "1(ShortToSupply_A!)" if v else ""),
"s2vsb": (lambda v: "1(LowSideShort_B!)" if v else ""), "s2vsb": (lambda v: "1(ShortToSupply_B!)" if v else ""),
}) })

View File

@ -239,6 +239,10 @@ Fields["TSTEP"] = {
SignedFields = ["cur_a", "cur_b", "sgt", "xactual", "vactual", "pwm_scale_auto"] SignedFields = ["cur_a", "cur_b", "sgt", "xactual", "vactual", "pwm_scale_auto"]
FieldFormatters = dict(tmc2130.FieldFormatters) FieldFormatters = dict(tmc2130.FieldFormatters)
FieldFormatters.update({
"s2vsa": (lambda v: "1(ShortToSupply_A!)" if v else ""),
"s2vsb": (lambda v: "1(ShortToSupply_B!)" if v else ""),
})
###################################################################### ######################################################################