aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/stepper.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-02-19 16:46:06 -0500
committerKevin O'Connor <kevin@koconnor.net>2020-02-20 13:24:53 -0500
commit245917bf034804acfa3039ac308c7d4308e79e86 (patch)
tree19073149cce99abac8003b6b97e1a91ae870a43b /klippy/stepper.py
parent332038ea017d458c27f1bb69fa7c17bfe36fcbd8 (diff)
downloadkutter-245917bf034804acfa3039ac308c7d4308e79e86.tar.gz
kutter-245917bf034804acfa3039ac308c7d4308e79e86.tar.xz
kutter-245917bf034804acfa3039ac308c7d4308e79e86.zip
mcu: Introduce new lookup_query_command() command wrapper
Use new mcu.lookup_query_command() for all commands that query information from the micro-controller. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/stepper.py')
-rw-r--r--klippy/stepper.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/klippy/stepper.py b/klippy/stepper.py
index 8b3f943b..1ec59974 100644
--- a/klippy/stepper.py
+++ b/klippy/stepper.py
@@ -84,8 +84,9 @@ class MCU_stepper:
"set_next_step_dir oid=%c dir=%c")
self._reset_cmd_id = self._mcu.lookup_command_id(
"reset_step_clock oid=%c clock=%u")
- self._get_position_cmd = self._mcu.lookup_command(
- "stepper_get_position oid=%c")
+ self._get_position_cmd = self._mcu.lookup_query_command(
+ "stepper_get_position oid=%c",
+ "stepper_position oid=%c pos=%i", oid=self._oid)
self._ffi_lib.stepcompress_fill(
self._stepqueue, self._mcu.seconds_to_clock(max_error),
self._invert_dir, step_cmd_id, dir_cmd_id)
@@ -134,8 +135,7 @@ class MCU_stepper:
raise error("Internal error in stepcompress")
if not did_trigger or self._mcu.is_fileoutput():
return
- params = self._get_position_cmd.send_with_response(
- [self._oid], response='stepper_position', response_oid=self._oid)
+ params = self._get_position_cmd.send([self._oid])
mcu_pos_dist = params['pos'] * self._step_dist
if self._invert_dir:
mcu_pos_dist = -mcu_pos_dist