diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-11-10 12:44:04 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-11-13 18:29:45 -0500 |
commit | 7554c7f69423bf3d22f340a8b4851c25de855983 (patch) | |
tree | 18a29f6829b7eb0cd77a49b4dc29b98631350c70 /klippy/chelper.py | |
parent | 79da35d023dade5718c9979405b6637f0f40888b (diff) | |
download | kutter-7554c7f69423bf3d22f340a8b4851c25de855983.tar.gz kutter-7554c7f69423bf3d22f340a8b4851c25de855983.tar.xz kutter-7554c7f69423bf3d22f340a8b4851c25de855983.zip |
stepcompress: Do all step rounding in C code
Commits f0cefebf and 8f331f08 changed the way the code determined what
steps to take on fractional steps. Unfortunately, it was possible in
some situations for the C code to round differently from the python
code which could result in warnings and lost steps.
Change the code so that all fractional step handling is done in the C
code. Implementing the step rounding logic in one location avoids any
conflicts.
In order to efficiently handle the step rounding in the C code, the C
code has also been extended to directly send the "set_next_step_dir"
command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/chelper.py')
-rw-r--r-- | klippy/chelper.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/klippy/chelper.py b/klippy/chelper.py index 5b7837ee..a3ce4a95 100644 --- a/klippy/chelper.py +++ b/klippy/chelper.py @@ -13,12 +13,14 @@ OTHER_FILES = ['list.h', 'serialqueue.h'] defs_stepcompress = """ struct stepcompress *stepcompress_alloc(uint32_t max_error - , uint32_t queue_step_msgid, uint32_t oid); - void stepcompress_push(struct stepcompress *sc, double step_clock); - double stepcompress_push_factor(struct stepcompress *sc + , uint32_t queue_step_msgid, uint32_t set_next_step_dir_msgid + , uint32_t invert_sdir, uint32_t oid); + void stepcompress_push(struct stepcompress *sc, double step_clock + , int32_t sdir); + int32_t stepcompress_push_factor(struct stepcompress *sc , double steps, double step_offset , double clock_offset, double factor); - double stepcompress_push_sqrt(struct stepcompress *sc + int32_t stepcompress_push_sqrt(struct stepcompress *sc , double steps, double step_offset , double clock_offset, double sqrt_offset, double factor); void stepcompress_reset(struct stepcompress *sc, uint64_t last_step_clock); |