On Sun, Sep 02, 2007 at 04:42:55PM +0800, Xuecheng Xi wrote:
> Dear Jeff:
> Thanks for your help.
> I have uploaded my prbs.c onto the wiki as you told me.
> http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?ContributedComponents

Thank you.  I hope others will add to this page as well.

> Two further problems I am interested in are
> 1) how the user can compile the file after downloading the
> user-contributed components
>  When I develop this module, I modified
> emc/src/Makefile,
> emc2/src/Makefile.inc
> so that it can be compiled.
> As you wrote in the last email, is it that easy to use emc2-dev to
> make the compilation an automatic process?

Yes, any single-file component should be installable with comp:
    comp --install prbs.c
however, I found that several changes were needed before it compiled on
my system (CVS TRUNK version, simulator):

--- prbs.c.orig 2007-09-01 09:35:06.000000000 -0500
+++ prbs.c      2007-09-02 08:23:06.000000000 -0500
@@ -26,20 +26,15 @@
 #include <rtapi.h>             /* RTAPI realtime OS API */
 #include <rtapi_app.h>         /* RTAPI realtime module decls */
 #include <hal.h>               /* HAL public API decls */
-#include "hal_priv.h"  /* HAL private API decls */
 
 
-#ifdef MODULE
 /* module information */
 MODULE_AUTHOR("Xue-Cheng Xi");
 MODULE_DESCRIPTION("PRBS signal generator for EMC HAL");
-#ifdef MODULE_LICENSE
 MODULE_LICENSE("GPL");
-#endif /* MODULE_LICENSE */
 static int num_chan = 2;       /* number of channels - default = 2 */
 MODULE_PARM(num_chan, "i");
 MODULE_PARM_DESC(num_chan, "number of channels");
-#endif /* MODULE */
 
 
 /***********************************************************************
@@ -291,7 +286,7 @@
                return retval;
     }
     rtapi_snprintf(buf, HAL_NAME_LEN, "prbs.%d.output", num);
-    retval = hal_pin_float_new(buf, HAL_RO, &(addr->output), comp_id);
+    retval = hal_pin_float_new(buf, HAL_OUT, &(addr->output), comp_id);
     if (retval != 0){
                return retval;
     }

After these changes, the component installed with 'comp --install' and I
was able to successfully load it.

> 2) How can I modify the my file later if I may want to improve it? Can
> the modifications be recorded as in CVS system?

I believe you can simply replace the existing file using 'upload', and
note in the page text that the component was updated on that date.
There is no revision control for uploaded files on the wiki.

Jeff

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to