Skip to content

Commit 4032845

Browse files
committed
Merge branch '2.8' to master
update command.c: EMCMOT_JOINT_ABORT handling as reqd
2 parents a0058e6 + 4657973 commit 4032845

1 file changed

Lines changed: 16 additions & 19 deletions

File tree

src/emc/motion/command.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -531,28 +531,25 @@ void emcmotCommandHandler(void *arg, long servo_period)
531531
break;
532532

533533
case EMCMOT_JOINT_ABORT:
534-
/* abort one joint */
534+
/* abort one joint number or axis number */
535535
/* can happen at any time */
536-
rtapi_print_msg(RTAPI_MSG_DBG, "JOINT_ABORT");
537-
rtapi_print_msg(RTAPI_MSG_DBG, " %d", joint_num);
538536
if (GET_MOTION_TELEOP_FLAG()) {
539-
/* tell teleop planner to stop */
540-
if ((emcmotCommand->axis >= 0) && (emcmotCommand->axis < EMCMOT_MAX_AXIS)) {
541-
axis_jog_abort(emcmotCommand->axis, 0);
542-
}
543-
} else if (GET_MOTION_COORD_FLAG()) {
544-
/* do nothing in coord mode */
537+
/* tell teleop planner to stop */
538+
if ((emcmotCommand->axis >= 0) && (emcmotCommand->axis < EMCMOT_MAX_AXIS)) {
539+
axis_jog_abort(emcmotCommand->axis, 0);
540+
}
545541
} else {
546-
/* tell joint planner to stop */
547-
if (joint != 0) joint->free_tp.enable = 0;
548-
/* validate joint */
549-
if (joint == 0) { break; }
550-
/* stop homing if in progress */
551-
if ( !get_home_is_idle(joint_num) ) {
552-
do_cancel_homing(joint_num);
553-
}
554-
/* update status flags */
555-
SET_JOINT_ERROR_FLAG(joint, 0);
542+
if (joint == 0) { break; }
543+
/* tell joint planner to stop */
544+
joint->free_tp.enable = 0;
545+
joint->kb_jjog_active = 0;
546+
joint->wheel_jjog_active = 0;
547+
/* stop homing if in progress */
548+
if ( !get_home_is_idle(joint_num) ) {
549+
do_cancel_homing(joint_num);
550+
}
551+
/* update status flags */
552+
SET_JOINT_ERROR_FLAG(joint, 0);
556553
}
557554
break;
558555

0 commit comments

Comments
 (0)