tmc: Add support for periodic checking of driver status

Check the status of all Trinamic stepper motor drivers once a second.
If the driver reports an error then invoke a shutdown.  Also log any
serious warnings.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-02-20 20:18:40 -05:00
parent 53b10d3ae7
commit f035de264f
3 changed files with 83 additions and 2 deletions

View file

@ -241,7 +241,8 @@ class TMC2130:
tmc.TMCVirtualPinHelper(config, self.mcu_tmc)
# Register commands
current_helper = TMCCurrentHelper(config, self.mcu_tmc)
cmdhelper = tmc.TMCCommandHelper(config, self.mcu_tmc, current_helper)
cmdhelper = tmc.TMCCommandHelper(config, self.mcu_tmc, current_helper,
clear_gstat=False)
cmdhelper.setup_register_dump(ReadRegisters)
# Setup basic register values
mh = tmc.TMCMicrostepHelper(config, self.mcu_tmc)