From bfa710525bea236ddf5787d6bfa7f5d00e611b3f Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Thu, 4 Nov 2021 11:14:03 +0100 Subject: [PATCH] Discard all remaining planned blocks with AbortPlannedMoves Previously it looked like only the active block has been discarded which worked most of the time, since we only planned single moves. But with introduction of PlanLongMove in one of the last commits this is not true anymore. --- src/modules/pulse_gen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/pulse_gen.cpp b/src/modules/pulse_gen.cpp index 755d09d..788977e 100644 --- a/src/modules/pulse_gen.cpp +++ b/src/modules/pulse_gen.cpp @@ -154,7 +154,8 @@ void PulseGen::AbortPlannedMoves(bool halt) { if (current_block) { last_rate = acc_step_rate; current_block = nullptr; - block_index.pop(); + while (!block_index.empty()) // drop all remaining blocks + block_index.pop(); } // truncate the last rate if halting