From: Joseph Coffland Date: Mon, 5 Sep 2016 01:23:29 +0000 (-0700) Subject: Alarm if machine position is set while the machine is moving X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=a25a88d6fe424f0b03a0c1a3187130533b8a7bd7;p=bbctrl-firmware Alarm if machine position is set while the machine is moving --- diff --git a/src/machine.c b/src/machine.c index f37f021..6fa9bcd 100644 --- a/src/machine.c +++ b/src/machine.c @@ -721,7 +721,10 @@ static void _exec_offset(float *value, float *flag) { * mp_get_runtime_busy() to be sure the system is quiescent. */ void mach_set_position(int axis, float position) { - // TODO: Interlock involving runtime_busy test + if ((mp_get_state() != STATE_HOLDING && mp_get_state() != STATE_READY) || + mp_get_runtime_busy()) + CM_ALARM(STAT_INTERNAL_ERROR); + mach.position[axis] = position; mach.ms.target[axis] = position; mp_set_planner_position(axis, position);