From 64e464987772059314a46d67b86aaeb51a0f3a40 Mon Sep 17 00:00:00 2001 From: Philipp Temminghoff Date: Mon, 11 Oct 2021 18:03:08 +0200 Subject: [PATCH] tmc: add current values to get_status() (#4696) Signed-off-by: Philipp Temminghoff --- docs/Status_Reference.md | 2 ++ klippy/extras/tmc.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/Status_Reference.md b/docs/Status_Reference.md index 049ddf1a..f1c9d6b3 100644 --- a/docs/Status_Reference.md +++ b/docs/Status_Reference.md @@ -331,6 +331,8 @@ objects (eg, `[tmc2208 stepper_x]`): - `drv_status`: The results of the last driver status query. (Only non-zero fields are reported.) This field will be null if the driver is not enabled (and thus is not periodically queried). +- `run_current`: The currently set run current. +- `hold_current`: The currently set hold current. ## toolhead diff --git a/klippy/extras/tmc.py b/klippy/extras/tmc.py index c926df63..d45d64ac 100644 --- a/klippy/extras/tmc.py +++ b/klippy/extras/tmc.py @@ -374,8 +374,11 @@ class TMCCommandHelper: cpos = None if self.stepper is not None and self.mcu_phase_offset is not None: cpos = self.stepper.mcu_to_commanded_position(self.mcu_phase_offset) + current = self.current_helper.get_current() res = {'mcu_phase_offset': self.mcu_phase_offset, - 'phase_offset_position': cpos} + 'phase_offset_position': cpos, + 'run_current': current[0], + 'hold_current': current[1]} res.update(self.echeck_helper.get_status(eventtime)) return res # DUMP_TMC support