tmc2208: Report write-only registers in DUMP_TMC

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-02-27 18:47:28 -05:00
parent 5dc487faf9
commit f7d8fde502
1 changed files with 7 additions and 0 deletions

View File

@ -352,6 +352,13 @@ class TMC2208:
self.printer.lookup_object('toolhead').get_last_move_time()
gcode = self.printer.lookup_object('gcode')
logging.info("DUMP_TMC %s", self.name)
gcode.respond_info("========== Write-only registers ==========")
for reg_name, val in self.regs.items():
if reg_name not in ReadRegisters:
msg = self.fields.pretty_format(reg_name, val)
logging.info(msg)
gcode.respond_info(msg)
gcode.respond_info("========== Queried registers ==========")
for reg_name in ReadRegisters:
try:
val = self.get_register(reg_name)