notify_on_stop errors if not moving

notify_on_stop now gives an error if it's
called while the stage is not moving.
This means you can safely issue the command and await a response.
If the stage is moving, it will block until
the stage stops.  If it's not moving, it will return immediately.
This commit is contained in:
Richard Bowman 2021-06-23 19:55:14 +01:00
parent 71f0da35a2
commit 165f619869

View file

@ -281,7 +281,14 @@ void is_stage_moving(String command)
void activate_notify_on_stop(String command)
{
notify_on_stop = true;
if (!stage_moving)
{
Serial.println("Error: stage is not moving");
}
else
{
notify_on_stop = true;
}
}
//TODO: move help strings to program memory