-/*
- * In on_main_loop, we check whether the queue should be running, but isn't.
- *
- * The main trigger for this event is other pieces of code adding gcode to a block, but not pushing it. This occurs frequently with gcodes that must be executed at the correct point in the queue, but take zero time to execute.
- * Smoothie will happily attach many of such gcodes onto a single block, to save room in the queue.
- *
- * Any gcode which can potentially take time to execute, or might like to halt the queue MUST push the head block, otherwise gcodes that arrive later may get executed at the same time, and gcode execution order strictness would be violated.
- *
- * If we get back to main loop context and the block has gcode but isn't pushed, then we can safely push it and start the queue.
- *
- *
- * It's also theoretically possible that a race condition could occur where we pop the final block and stop the queue, while at the same time main loop is pushing head but thinks the queue is running and thus does not start it.
- *
- * In this case, we start the queue again when execution returns to main loop.
- * No stuttering or other visible effects could be caused by this event, as the planner will have set the last block to decelerate to zero, and the new block to accelerate from zero.
- *
- */
-
-void Conveyor::on_main_loop(void*)
+// see if we are idle
+// this checks the block queue is empty, and that the step queue is empty and
+// checks that all motors are no longer moving
+bool Conveyor::is_idle() const