trapq: Set the head sentinel to a negative print_time

If a stepper kinematics has a "scan window" defined during its first
flush then the iterative solver may walk past the head sentinel.  Set
a small negative print_time for the head sentinel to avoid this corner
case.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2025-09-03 21:59:26 -04:00
parent 32bd03703b
commit b60804bb66

View File

@@ -49,6 +49,7 @@ trapq_alloc(void)
list_init(&tq->moves); list_init(&tq->moves);
list_init(&tq->history); list_init(&tq->history);
struct move *head_sentinel = move_alloc(), *tail_sentinel = move_alloc(); struct move *head_sentinel = move_alloc(), *tail_sentinel = move_alloc();
head_sentinel->print_time = -1.0;
tail_sentinel->print_time = tail_sentinel->move_t = NEVER_TIME; tail_sentinel->print_time = tail_sentinel->move_t = NEVER_TIME;
list_add_head(&head_sentinel->node, &tq->moves); list_add_head(&head_sentinel->node, &tq->moves);
list_add_tail(&tail_sentinel->node, &tq->moves); list_add_tail(&tail_sentinel->node, &tq->moves);