Empty the entire block_index queue when planned moves are aborted

pull/228/head
Guðni Már Gilbert 2022-10-22 13:06:35 +00:00
parent c2601d9a34
commit 7bbee87a08
1 changed files with 4 additions and 2 deletions

View File

@ -160,10 +160,12 @@ void PulseGen::AbortPlannedMoves(bool halt) {
if (current_block) { if (current_block) {
last_rate = acc_step_rate; last_rate = acc_step_rate;
current_block = nullptr; 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 // truncate the last rate if halting
if (halt) if (halt)
last_rate = 0; last_rate = 0;