On 1/28/10, Alex Joni <[email protected]> wrote:
> "The warnings are related to the newer gcc 4.3.2 and can be fixed by
> configuring RTAI for "eager inline" (extended config in the first
> menuconfig window)."
>
> from https://mail.rtai.org/pipermail/rtai/2009-February/021007.html
>
> Maybe that fixes the bug too?

Hi Alex,
I can try this tomorrow.

I converted ctrl_type to an int array and there is no problem now. The
patch is attached

acemi
--- emc2-dev/src/hal/components/stepgen.c	2010-01-28 12:30:22.000000000 +0200
+++ myplace_2.3.4/src/hal/components/stepgen.c	2010-01-28 12:27:23.000000000 +0200
@@ -316,8 +316,8 @@ MODULE_DESCRIPTION("Step Pulse Generator
 MODULE_LICENSE("GPL");
 int step_type[MAX_CHAN] = { -1, -1, -1, -1, -1, -1, -1, -1 };
 RTAPI_MP_ARRAY_INT(step_type,MAX_CHAN,"stepping types for up to 8 channels");
-const char *ctrl_type[MAX_CHAN] = { "p", "p", "p", "p", "p", "p", "p", "p" };
-RTAPI_MP_ARRAY_STRING(ctrl_type,MAX_CHAN,"control type (pos or vel) for up to 8 channels");
+int ctrl_type[MAX_CHAN] = { 1, 1, 1, 1, 1, 1, 1, 1 };
+RTAPI_MP_ARRAY_INT(ctrl_type,MAX_CHAN,"control type (pos or vel) for up to 8 channels");
 
 /***********************************************************************
 *                STRUCTURES AND GLOBAL VARIABLES                       *
@@ -446,13 +446,9 @@ int rtapi_app_main(void)
 			    step_type[n], n);
 	    return -1;
 	}
-	if ((ctrl_type[n][0] == 'p' ) || (ctrl_type[n][0] == 'P')) {
-	    ctrl_type[n] = "p";
-	} else if ((ctrl_type[n][0] == 'v' ) || (ctrl_type[n][0] == 'V')) {
-	    ctrl_type[n] = "v";
-	} else {
+	if ((ctrl_type[n] != 0 ) && (ctrl_type[n] != 1)) {
 	    rtapi_print_msg(RTAPI_MSG_ERR,
-			    "STEPGEN: ERROR: bad control type '%s' for axis %i (must be 'p' or 'v')\n",
+			    "STEPGEN: ERROR: bad control type '%i' for axis %i (must be 1 or 0)\n",
 			    ctrl_type[n], n);
 	    return -1;
 	}
@@ -494,7 +490,7 @@ int rtapi_app_main(void)
     for (n = 0; n < num_chan; n++) {
 	/* export all vars */
 	retval = export_stepgen(n, &(stepgen_array[n]),
-	    step_type[n], (ctrl_type[n][0] == 'p'));
+	    step_type[n], ctrl_type[n]);
 	if (retval != 0) {
 	    rtapi_print_msg(RTAPI_MSG_ERR,
 		"STEPGEN: ERROR: stepgen %d var export failed\n", n);
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to