diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-05-05 20:59:33 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-05-05 20:59:33 -0400 |
commit | 99b233df3f120271f6ccbbae595edc5f13a5c2ea (patch) | |
tree | 1609014af46203f7efe4c72a6b1aff3317f978db /klippy/chelper/serialqueue.c | |
parent | 640ff1ad566361f5a57c4827aa0185be958933af (diff) | |
download | kutter-99b233df3f120271f6ccbbae595edc5f13a5c2ea.tar.gz kutter-99b233df3f120271f6ccbbae595edc5f13a5c2ea.tar.xz kutter-99b233df3f120271f6ccbbae595edc5f13a5c2ea.zip |
serialqueue: Fix batching of BACKGROUND_PRIORITY_CLOCK messages
In order to properly delay BACKGROUND_PRIORITY_CLOCK messages, they
must be 5ms beyond the minimum defined by MIN_REQTIME_DELTA. So, add
both MIN_REQTIME_DELTA and MIN_BACKGROUND_DELTA to the timing of these
messages.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/chelper/serialqueue.c')
-rw-r--r-- | klippy/chelper/serialqueue.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/klippy/chelper/serialqueue.c b/klippy/chelper/serialqueue.c index 2f7c25a5..ab55d176 100644 --- a/klippy/chelper/serialqueue.c +++ b/klippy/chelper/serialqueue.c @@ -726,7 +726,8 @@ check_send_command(struct serialqueue *sq, double eventtime) uint64_t req_clock = qm->req_clock; if (req_clock == BACKGROUND_PRIORITY_CLOCK) req_clock = (uint64_t)( - (sq->idle_time - sq->last_clock_time + MIN_BACKGROUND_DELTA) + (sq->idle_time - sq->last_clock_time + + MIN_REQTIME_DELTA + MIN_BACKGROUND_DELTA) * sq->est_freq) + sq->last_clock; if (req_clock < min_ready_clock) min_ready_clock = req_clock; |