From f3a49604f1fdbefc87010fb2a51070c7421aa7f0 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 23 Dec 2016 23:13:35 -0500 Subject: [PATCH] stepcompress: Increase check on max count to 10000000 Some motors have very small step distances and they can generate over a million steps during a homing operation. Increase the maximum count to ten million to avoid triggering the internal sanity check. Signed-off-by: Kevin O'Connor --- klippy/stepcompress.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/klippy/stepcompress.c b/klippy/stepcompress.c index 34578935..e52b1035 100644 --- a/klippy/stepcompress.c +++ b/klippy/stepcompress.c @@ -395,7 +395,7 @@ stepcompress_push_factor(struct stepcompress *sc step_offset = -step_offset; } int count = steps + .5 - step_offset; - if (count <= 0 || count > 1000000) { + if (count <= 0 || count > 10000000) { if (count && steps) errorf("push_factor invalid count %d %f %f %f %f" , sc->oid, steps, step_offset, clock_offset, factor); @@ -429,7 +429,7 @@ stepcompress_push_sqrt(struct stepcompress *sc, double steps, double step_offset step_offset = -step_offset; } int count = steps + .5 - step_offset; - if (count <= 0 || count > 1000000) { + if (count <= 0 || count > 10000000) { if (count && steps) errorf("push_sqrt invalid count %d %f %f %f %f %f" , sc->oid, steps, step_offset, clock_offset, sqrt_offset @@ -463,7 +463,7 @@ stepcompress_push_delta_const( double reldist = closestxy_d - movexy_r*dist; double end_height = safe_sqrt(closest_height2 - reldist*reldist); int count = (end_height - height + movez_r*dist) / step_dist + .5; - if (count <= 0 || count > 1000000) { + if (count <= 0 || count > 10000000) { if (count) errorf("push_delta_const invalid count %d %d %f %f %f %f %f %f %f %f" , sc->oid, count, clock_offset, dist, step_dist, start_pos @@ -519,7 +519,7 @@ stepcompress_push_delta_accel( double reldist = closestxy_d - movexy_r*dist; double end_height = safe_sqrt(closest_height2 - reldist*reldist); int count = (end_height - height + movez_r*dist) / step_dist + .5; - if (count <= 0 || count > 1000000) { + if (count <= 0 || count > 10000000) { if (count) errorf("push_delta_accel invalid count %d %d %f %f %f %f %f %f %f %f" , sc->oid, count, clock_offset, dist, step_dist, start_pos