Allow the queue to be cleared from within commands
This commit is contained in:
parent
c450851401
commit
0d4ff0c48b
@ -990,8 +990,11 @@ void loop() {
|
|||||||
|
|
||||||
#endif // SDSUPPORT
|
#endif // SDSUPPORT
|
||||||
|
|
||||||
commands_in_queue--;
|
// The queue may be reset by a command handler or by code invoked by idle() within a handler
|
||||||
cmd_queue_index_r = (cmd_queue_index_r + 1) % BUFSIZE;
|
if (commands_in_queue) {
|
||||||
|
--commands_in_queue;
|
||||||
|
cmd_queue_index_r = (cmd_queue_index_r + 1) % BUFSIZE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
endstops.report_state();
|
endstops.report_state();
|
||||||
idle();
|
idle();
|
||||||
|
Loading…
Reference in New Issue
Block a user