toolhead: Allow more entries to flush from "lazy" lookahead flush

Previously the code would always keep at least 2 items on the
lookahead queue after a "lazy" flush.  In most cases it's okay to
leave only a single item.  Update the code to better handle flushing
of items that are fully ready.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2025-09-26 11:43:19 -04:00
parent 41901ec382
commit 6118525c19

View file

@ -156,7 +156,7 @@ class LookAheadQueue:
# This move can both accel and decel, or this is a
# full accel move followed by a full decel move
if update_flush_count and peak_cruise_v2:
flush_count = i
flush_count = i + pending_cv2_assign
update_flush_count = False
peak_cruise_v2 = (mcr_start_v2 + reach_mcr_start_v2) * .5
cruise_v2 = min((start_v2 + reachable_start_v2) * .5