[ create a new paste ] login | about

Link: http://codepad.org/8piHJGaK    [ raw code | fork ]

C, pasted on Sep 16:
diff --git a/src/emc/motion/homing.c b/src/emc/motion/homing.c
index fd9ea31..efc6f21 100644
--- a/src/emc/motion/homing.c
+++ b/src/emc/motion/homing.c
@@ -70,14 +70,14 @@ static void home_start_move(emcmot_joint_t * joint, double vel)
    hit a limit, or if the move has stopped.  (Normally such moves
    will be terminated by the home switch or an index pulse or some
    other event, if the move goes to completion, something is wrong.) */
-static void home_do_moving_checks(emcmot_joint_t * joint)
+static void home_do_moving_checks(emcmot_joint_t * joint, int joint_num)
 {
     /* check for limit switches */
     if (joint->on_pos_limit || joint->on_neg_limit) {
 	/* on limit, check to see if we should trip */
 	if (!(joint->home_flags & HOME_IGNORE_LIMITS)) {
 	    /* not ignoring limits, time to quit */
-	    reportError(_("hit limit in home state %d"), joint->home_state);
+	    reportError(_("joint %d hit limit in home state %d"), joint_num, joint->home_state);
 	    joint->home_state = HOME_ABORT;
 	    immediate_state = 1;
 	    return;
@@ -87,7 +87,7 @@ static void home_do_moving_checks(emcmot_joint_t * joint)
     if (!joint->free_tp_active) {
 	/* reached end of move without hitting switch */
 	joint->free_tp_enable = 0;
-	reportError(_("end of move in home state %d"), joint->home_state);
+	reportError(_("joint %d end of move in home state %d"), joint_num, joint->home_state);
 	joint->home_state = HOME_ABORT;
 	immediate_state = 1;
 	return;
@@ -243,7 +243,7 @@ void do_homing(void)
 		   determines what state is next */
 		if (joint->home_flags & HOME_IS_SHARED && home_sw_active) {
 		    reportError(
-			_("Cannot home while shared home switch is closed"));
+			_("Cannot home joint %d while shared home switch is closed"), joint_num);
 		    joint->home_state = HOME_IDLE;
 		    break;
 		}
@@ -287,7 +287,8 @@ void do_homing(void)
 			joint->home_state = HOME_INDEX_ONLY_START;
 			immediate_state = 1;
 		    } else {
-			reportError(_("invalid homing config: non-zero LATCH_VEL needs either SEARCH_VEL or USE_INDEX"));
+			reportError(_("joint %d invalid homing config: non-zero LATCH_VEL needs either SEARCH_VEL or USE_INDEX"),
+			  joint_num);
 			joint->home_state = HOME_IDLE;
 		    }
 		} else {
@@ -296,7 +297,8 @@ void do_homing(void)
 			joint->home_state = HOME_INITIAL_SEARCH_START;
 			immediate_state = 1;
 		    } else {
-			reportError(_("invalid homing config: non-zero SEARCH_VEL needs LATCH_VEL"));
+			reportError(_("joint %d invalid homing config: non-zero SEARCH_VEL needs LATCH_VEL"),
+			  joint_num);
 			joint->home_state = HOME_IDLE;
 		    }
 		}
@@ -339,7 +341,7 @@ void do_homing(void)
 		    immediate_state = 1;
 		    break;
 		}
-		home_do_moving_checks(joint);
+		home_do_moving_checks(joint, joint_num);
 		break;
 
 	    case HOME_INITIAL_SEARCH_START:
@@ -387,7 +389,7 @@ void do_homing(void)
 		    immediate_state = 1;
 		    break;
 		}
-		home_do_moving_checks(joint);
+		home_do_moving_checks(joint, joint_num);
 		break;
 
 	    case HOME_SET_COARSE_POSITION:
@@ -444,7 +446,7 @@ void do_homing(void)
 		/* we should still be on the switch */
 		if (! home_sw_active) {
 		    reportError(
-			_("Home switch inactive before start of backoff move"));
+			_("Joint %d home switch inactive before start of backoff move"), joint_num);
 		    joint->home_state = HOME_IDLE;
 		    break;
 		}
@@ -469,7 +471,7 @@ void do_homing(void)
 		    immediate_state = 1;
 		    break;
 		}
-		home_do_moving_checks(joint);
+		home_do_moving_checks(joint, joint_num);
 		break;
 
 	    case HOME_RISE_SEARCH_START:
@@ -492,7 +494,7 @@ void do_homing(void)
 		/* we should still be off of the switch */
 		if (home_sw_active) {
 		    reportError(
-			_("Home switch active before start of latch move"));
+			_("Joint %d home switch active before start of latch move"), joint_num);
 		    joint->home_state = HOME_IDLE;
 		    break;
 		}
@@ -525,7 +527,7 @@ void do_homing(void)
 			break;
 		    }
 		}
-		home_do_moving_checks(joint);
+		home_do_moving_checks(joint, joint_num);
 		break;
 
 	    case HOME_FALL_SEARCH_START:
@@ -548,7 +550,7 @@ void do_homing(void)
 		/* we should still be on the switch */
 		if (!home_sw_active) {
 		    reportError(
-			_("Home switch inactive before start of latch move"));
+			_("Joint %d home switch inactive before start of latch move"), joint_num);
 		    joint->home_state = HOME_IDLE;
 		    break;
 		}
@@ -581,7 +583,7 @@ void do_homing(void)
 			break;
 		    }
 		}
-		home_do_moving_checks(joint);
+		home_do_moving_checks(joint, joint_num);
 		break;
 
 	    case HOME_SET_SWITCH_POSITION:
@@ -653,7 +655,7 @@ void do_homing(void)
 		/* and move right into the waiting state */
 		joint->home_state = HOME_INDEX_SEARCH_WAIT;
 		immediate_state = 1;
-		home_do_moving_checks(joint);
+		home_do_moving_checks(joint, joint_num);
 		break;
 
 	    case HOME_INDEX_SEARCH_WAIT:
@@ -673,7 +675,7 @@ void do_homing(void)
 		    immediate_state = 1;
 		    break;
 		}
-		home_do_moving_checks(joint);
+		home_do_moving_checks(joint, joint_num);
 		break;
 
 	    case HOME_SET_INDEX_POSITION:
@@ -745,8 +747,8 @@ void do_homing(void)
 		    /* on limit, check to see if we should trip */
 		    if (!(joint->home_flags & HOME_IGNORE_LIMITS)) {
 			/* not ignoring limits, time to quit */
-			reportError(_("hit limit in home state %d"),
-			    joint->home_state);
+			reportError(_("Joint %d hit limit in home state %d"),
+			    joint_num, joint->home_state);
 			joint->home_state = HOME_ABORT;
 			immediate_state = 1;
 			break;


Create a new paste based on this one


Comments: