diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-08-06 09:56:06 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-08-06 11:19:36 -0400 |
commit | b17ec3d2e9d0afb96351a6ed26fba958584899ac (patch) | |
tree | 8b4ff3409373ecb5ebeb3b7fead0a3b4949efc4a /klippy/chelper/stepcompress.c | |
parent | 3176150050b666a582ac0993dc14e6663133ecb9 (diff) | |
download | kutter-b17ec3d2e9d0afb96351a6ed26fba958584899ac.tar.gz kutter-b17ec3d2e9d0afb96351a6ed26fba958584899ac.tar.xz kutter-b17ec3d2e9d0afb96351a6ed26fba958584899ac.zip |
stepcompress: Pass clock to stepcompress_set_last_position()
Using sc->last_step_clock for the last position marker does not work
properly, because the stepper.py code calls stepcompress_reset() prior
to calling stepcompress_set_last_position(). Fix by passing an
explicit clock to stepcompress_set_last_position().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/chelper/stepcompress.c')
-rw-r--r-- | klippy/chelper/stepcompress.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/klippy/chelper/stepcompress.c b/klippy/chelper/stepcompress.c index fab15a2c..b38b72ad 100644 --- a/klippy/chelper/stepcompress.c +++ b/klippy/chelper/stepcompress.c @@ -553,7 +553,8 @@ stepcompress_reset(struct stepcompress *sc, uint64_t last_step_clock) // Set last_position in the stepcompress object int __visible -stepcompress_set_last_position(struct stepcompress *sc, int64_t last_position) +stepcompress_set_last_position(struct stepcompress *sc, uint64_t clock + , int64_t last_position) { int ret = stepcompress_flush(sc, UINT64_MAX); if (ret) @@ -563,7 +564,7 @@ stepcompress_set_last_position(struct stepcompress *sc, int64_t last_position) // Add a marker to the history list struct history_steps *hs = malloc(sizeof(*hs)); memset(hs, 0, sizeof(*hs)); - hs->first_clock = hs->last_clock = sc->last_step_clock; + hs->first_clock = hs->last_clock = clock; hs->start_position = last_position; list_add_head(&hs->node, &sc->history_list); return 0; |