Skip to content

Commit dc5f1c1

Browse files
committed
probe_error_decel_no_inhibit rebased for 2.9
1 parent 0eab8f8 commit dc5f1c1

1 file changed

Lines changed: 45 additions & 41 deletions

File tree

src/emc/motion/control.c

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -716,59 +716,63 @@ static void process_probe_inputs(void)
716716
} else if (!old_probeVal && emcmotStatus->probeVal) {
717717
// not probing, but we have a rising edge on the probe.
718718
// this could be expensive if we don't stop.
719-
int i;
720-
int aborted = 0;
721719

722720
if(!GET_MOTION_INPOS_FLAG() && tpQueueDepth(&emcmotInternal->coord_tp)) {
723721
// running an command
724-
tpAbort(&emcmotInternal->coord_tp);
725-
reportError(_("Probe tripped during non-probe move."));
726-
SET_MOTION_ERROR_FLAG(1);
727-
}
722+
if (emcmotStatus->motionType != EMC_MOTION_TYPE_PROBING) {
723+
tpAbort(&emcmotInternal->coord_tp);
724+
reportError(_("Probe tripped during non-probe move."));
725+
SET_MOTION_ERROR_FLAG(1);
726+
}
727+
} else {
728+
// not running a command
729+
int i;
730+
int aborted = 0;
728731

729-
for(i=0; i<NO_OF_KINS_JOINTS; i++) {
730-
emcmot_joint_t *joint = &joints[i];
732+
for(i=0; i<NO_OF_KINS_JOINTS; i++) {
733+
emcmot_joint_t *joint = &joints[i];
731734

732-
if (!GET_JOINT_ACTIVE_FLAG(joint)) {
733-
/* if joint is not active, skip it */
734-
continue;
735-
}
735+
if (!GET_JOINT_ACTIVE_FLAG(joint)) {
736+
/* if joint is not active, skip it */
737+
continue;
738+
}
736739

737-
// inhibit_probe_home_error is set by [TRAJ]->NO_PROBE_HOME_ERROR in the ini file
738-
if (!emcmotConfig->inhibit_probe_home_error) {
739-
// abort any homing
740-
if(get_homing(i)) {
741-
do_cancel_homing(i);
742-
aborted=1;
740+
// inhibit_probe_home_error is set by [TRAJ]->NO_PROBE_HOME_ERROR in the ini file
741+
if (!emcmotConfig->inhibit_probe_home_error) {
742+
// abort any homing
743+
if(get_homing(i)) {
744+
do_cancel_homing(i);
745+
aborted=1;
746+
}
743747
}
744-
}
745748

746-
// inhibit_probe_jog_error is set by [TRAJ]->NO_PROBE_JOG_ERROR in the ini file
747-
if (!emcmotConfig->inhibit_probe_jog_error) {
748-
// abort any joint jogs
749-
if(joint->free_tp.enable == 1) {
750-
joint->free_tp.enable = 0;
751-
// since homing uses free_tp, this protection of aborted
752-
// is needed so the user gets the correct error.
753-
if(!aborted) aborted=2;
749+
// inhibit_probe_jog_error is set by [TRAJ]->NO_PROBE_JOG_ERROR in the ini file
750+
if (!emcmotConfig->inhibit_probe_jog_error) {
751+
// abort any joint jogs
752+
if(joint->free_tp.enable == 1) {
753+
joint->free_tp.enable = 0;
754+
// since homing uses free_tp, this protection of aborted
755+
// is needed so the user gets the correct error.
756+
if(!aborted) aborted=2;
757+
}
754758
}
755759
}
756-
}
757-
if (!emcmotConfig->inhibit_probe_jog_error) {
758-
if (axis_jog_abort_all(1)) {
759-
aborted = 3;
760+
if (!emcmotConfig->inhibit_probe_jog_error) {
761+
if (axis_jog_abort_all(1)) {
762+
aborted = 3;
763+
}
760764
}
761-
}
762765

763-
if(aborted == 1) {
764-
reportError(_("Probe tripped during homing motion."));
765-
}
766+
if(aborted == 1) {
767+
reportError(_("Probe tripped during homing motion."));
768+
}
766769

767-
if(aborted == 2) {
768-
reportError(_("Probe tripped during a joint jog."));
769-
}
770-
if(aborted == 3) {
771-
reportError(_("Probe tripped during a coordinate jog."));
770+
if(aborted == 2) {
771+
reportError(_("Probe tripped during a joint jog."));
772+
}
773+
if(aborted == 3) {
774+
reportError(_("Probe tripped during a coordinate jog."));
775+
}
772776
}
773777
}
774778
old_probeVal = emcmotStatus->probeVal;
@@ -2178,4 +2182,4 @@ static void update_status(void)
21782182
old_motion_flag = emcmotStatus->motionFlag;
21792183
}
21802184
#endif
2181-
}
2185+
}

0 commit comments

Comments
 (0)