From 7bbee87a0898ec82a8108e3f7f4ce0cb68d5097b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 22 Oct 2022 13:06:35 +0000 Subject: [PATCH] Empty the entire block_index queue when planned moves are aborted --- src/modules/pulse_gen.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/pulse_gen.cpp b/src/modules/pulse_gen.cpp index d673d9d..4d85b21 100644 --- a/src/modules/pulse_gen.cpp +++ b/src/modules/pulse_gen.cpp @@ -160,10 +160,12 @@ void PulseGen::AbortPlannedMoves(bool halt) { if (current_block) { last_rate = acc_step_rate; current_block = nullptr; - while (!block_index.empty()) // drop all remaining blocks - block_index.pop(); } + // drop all remaining blocks + while (!block_index.empty()) + block_index.pop(); + // truncate the last rate if halting if (halt) last_rate = 0;