Merge pull request #228 from gudnimg/abortplannedmoves-gudni

Empty the entire block_index queue when planned moves are aborted
pull/225/head
Guðni Már Gilbert 2022-10-22 14:44:24 +00:00 committed by GitHub
commit 709b616948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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;