@@ -718,59 +718,63 @@ static void process_probe_inputs(void)
718718 } else if (!old_probeVal && emcmotStatus -> probeVal ) {
719719 // not probing, but we have a rising edge on the probe.
720720 // this could be expensive if we don't stop.
721- int i ;
722- int aborted = 0 ;
723721
724722 if (!GET_MOTION_INPOS_FLAG () && tpQueueDepth (& emcmotInternal -> coord_tp )) {
725723 // running an command
726- tpAbort (& emcmotInternal -> coord_tp );
727- reportError (_ ("Probe tripped during non-probe move." ));
728- SET_MOTION_ERROR_FLAG (1 );
729- }
724+ if (emcmotStatus -> motionType != EMC_MOTION_TYPE_PROBING ) {
725+ tpAbort (& emcmotInternal -> coord_tp );
726+ reportError (_ ("Probe tripped during non-probe move." ));
727+ SET_MOTION_ERROR_FLAG (1 );
728+ }
729+ } else {
730+ // not running a command
731+ int i ;
732+ int aborted = 0 ;
730733
731- for (i = 0 ; i < NO_OF_KINS_JOINTS ; i ++ ) {
732- emcmot_joint_t * joint = & joints [i ];
734+ for (i = 0 ; i < NO_OF_KINS_JOINTS ; i ++ ) {
735+ emcmot_joint_t * joint = & joints [i ];
733736
734- if (!GET_JOINT_ACTIVE_FLAG (joint )) {
735- /* if joint is not active, skip it */
736- continue ;
737- }
737+ if (!GET_JOINT_ACTIVE_FLAG (joint )) {
738+ /* if joint is not active, skip it */
739+ continue ;
740+ }
738741
739- // inhibit_probe_home_error is set by [TRAJ]->NO_PROBE_HOME_ERROR in the ini file
740- if (!emcmotConfig -> inhibit_probe_home_error ) {
741- // abort any homing
742- if (get_homing (i )) {
743- do_cancel_homing (i );
744- aborted = 1 ;
742+ // inhibit_probe_home_error is set by [TRAJ]->NO_PROBE_HOME_ERROR in the ini file
743+ if (!emcmotConfig -> inhibit_probe_home_error ) {
744+ // abort any homing
745+ if (get_homing (i )) {
746+ do_cancel_homing (i );
747+ aborted = 1 ;
748+ }
745749 }
746- }
747750
748- // inhibit_probe_jog_error is set by [TRAJ]->NO_PROBE_JOG_ERROR in the ini file
749- if (!emcmotConfig -> inhibit_probe_jog_error ) {
750- // abort any joint jogs
751- if (joint -> free_tp .enable == 1 ) {
752- joint -> free_tp .enable = 0 ;
753- // since homing uses free_tp, this protection of aborted
754- // is needed so the user gets the correct error.
755- if (!aborted ) aborted = 2 ;
751+ // inhibit_probe_jog_error is set by [TRAJ]->NO_PROBE_JOG_ERROR in the ini file
752+ if (!emcmotConfig -> inhibit_probe_jog_error ) {
753+ // abort any joint jogs
754+ if (joint -> free_tp .enable == 1 ) {
755+ joint -> free_tp .enable = 0 ;
756+ // since homing uses free_tp, this protection of aborted
757+ // is needed so the user gets the correct error.
758+ if (!aborted ) aborted = 2 ;
759+ }
756760 }
757761 }
758- }
759- if (! emcmotConfig -> inhibit_probe_jog_error ) {
760- if ( axis_jog_abort_all ( 1 )) {
761- aborted = 3 ;
762+ if (! emcmotConfig -> inhibit_probe_jog_error ) {
763+ if (axis_jog_abort_all ( 1 ) ) {
764+ aborted = 3 ;
765+ }
762766 }
763- }
764767
765- if (aborted == 1 ) {
766- reportError (_ ("Probe tripped during homing motion." ));
767- }
768+ if (aborted == 1 ) {
769+ reportError (_ ("Probe tripped during homing motion." ));
770+ }
768771
769- if (aborted == 2 ) {
770- reportError (_ ("Probe tripped during a joint jog." ));
771- }
772- if (aborted == 3 ) {
773- reportError (_ ("Probe tripped during a coordinate jog." ));
772+ if (aborted == 2 ) {
773+ reportError (_ ("Probe tripped during a joint jog." ));
774+ }
775+ if (aborted == 3 ) {
776+ reportError (_ ("Probe tripped during a coordinate jog." ));
777+ }
774778 }
775779 }
776780 old_probeVal = emcmotStatus -> probeVal ;
@@ -2180,4 +2184,4 @@ static void update_status(void)
21802184 old_motion_flag = emcmotStatus -> motionFlag ;
21812185 }
21822186#endif
2183- }
2187+ }
0 commit comments