aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-03-12 12:29:20 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-03-16 13:15:25 -0400
commit0041a0079d91755ec1522f0a3b153ea5389b1967 (patch)
treea387a8e3b86fd3bb92decb779bfe16a42383c4b6 /klippy
parent9bb8b0c622bf5cba38e5e2c4b59b466444e572d7 (diff)
downloadkutter-0041a0079d91755ec1522f0a3b153ea5389b1967.tar.gz
kutter-0041a0079d91755ec1522f0a3b153ea5389b1967.tar.xz
kutter-0041a0079d91755ec1522f0a3b153ea5389b1967.zip
stepcompress: Improve check_line() error messages
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/stepcompress.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/klippy/stepcompress.c b/klippy/stepcompress.c
index 5b401cbe..962039cd 100644
--- a/klippy/stepcompress.c
+++ b/klippy/stepcompress.c
@@ -233,16 +233,18 @@ check_line(struct stepcompress *sc, struct step_move move)
if (move.count == 1) {
if (move.interval != (uint32_t)(*sc->queue_pos - sc->last_step_clock)
|| *sc->queue_pos < sc->last_step_clock) {
- errorf("Count 1 point out of range: %d %d %d"
- , move.interval, move.count, move.add);
+ errorf("stepcompress o=%d i=%d c=%d a=%d:"
+ " Count 1 point out of range (%lld)"
+ , sc->oid, move.interval, move.count, move.add
+ , (long long)(*sc->queue_pos - sc->last_step_clock));
return ERROR_RET;
}
return 0;
}
if (!move.count || (!move.interval && !move.add)
|| move.interval >= 0x80000000) {
- errorf("Point out of range: %d %d %d"
- , move.interval, move.count, move.add);
+ errorf("stepcompress o=%d i=%d c=%d a=%d: Invalid sequence"
+ , sc->oid, move.interval, move.count, move.add);
return ERROR_RET;
}
uint32_t interval = move.interval, p = 0;
@@ -251,13 +253,16 @@ check_line(struct stepcompress *sc, struct step_move move)
struct points point = minmax_point(sc, sc->queue_pos + i);
p += interval;
if (p < point.minp || p > point.maxp) {
- errorf("Point %d of %d: %d not in %d:%d"
- , i+1, move.count, p, point.minp, point.maxp);
+ errorf("stepcompress o=%d i=%d c=%d a=%d: Point %d: %d not in %d:%d"
+ , sc->oid, move.interval, move.count, move.add
+ , i+1, p, point.minp, point.maxp);
return ERROR_RET;
}
if (interval >= 0x80000000) {
- errorf("Point %d of %d: interval overflow %d"
- , i+1, move.count, interval);
+ errorf("stepcompress o=%d i=%d c=%d a=%d:"
+ " Point %d: interval overflow %d"
+ , sc->oid, move.interval, move.count, move.add
+ , i+1, interval);
return ERROR_RET;
}
interval += move.add;