On 5/25/06, Alejandro Romero Morales <[EMAIL PROTECTED]> wrote:
Dear David,
thanks for your answer.
I have seem the app.c file created for telosb and it is a little confused!! :-)
My problem now is to know if it is possible to add code to this C file or an
independent module to use this functions and recompile all again including the
funcionalities written in C and how. The target is to reuse code written in C
from old projects.
Do you have any experience similar to this? Do you know somebody that can help
me in this matter?
Either:
- include the code in a module (module bodies are essentially C code)
- or, just compile your C code as usual, and link it in at compile-time, i.e.:
foo.h:
void myfunction(int myarg);
foo.c:
void myfunction(int myarg) { do something fun }
gloop.nc: (wants to use the stuff in foo)
includes foo;
module gloop { whatever }
implementation {
... myfunction(23); ...
}
compiling it all:
cc -c foo.c
ncc <your favourite options> <your toplevel component>.nc foo.o
Integrating this with the TinyOS makefile system is left as an
exercise to the reader (this is one of the drawbacks of the
super-duper makefile system...)
David Gay
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help