mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-16 03:07:56 -06:00
stepcompress: Return number of steps traveled from stepcompress_push()
Return the same information from stepcompress_push() that is returned from stepcompress_push_const() and stpcompress_push_delta(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
52156d2c41
commit
14810d7e80
3 changed files with 7 additions and 10 deletions
|
@ -108,14 +108,11 @@ class MCU_stepper:
|
|||
if ret:
|
||||
raise error("Internal error in stepcompress")
|
||||
def step(self, mcu_time, sdir):
|
||||
clock = mcu_time * self._mcu_freq
|
||||
ret = self._ffi_lib.stepcompress_push(self._stepqueue, clock, sdir)
|
||||
if ret:
|
||||
count = self._ffi_lib.stepcompress_push(
|
||||
self._stepqueue, mcu_time * self._mcu_freq, sdir)
|
||||
if count == STEPCOMPRESS_ERROR_RET:
|
||||
raise error("Internal error in stepcompress")
|
||||
if sdir:
|
||||
self._commanded_pos += 1
|
||||
else:
|
||||
self._commanded_pos -= 1
|
||||
self._commanded_pos += count
|
||||
def step_const(self, mcu_time, start_pos, dist, start_v, accel):
|
||||
inv_step_dist = self._inv_step_dist
|
||||
step_offset = self._commanded_pos - start_pos * inv_step_dist
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue