Steve,
In the message below, you indicated that you can make calls to C
functions from within nesC code. I'm attempting to do so by following your
instructions, but the nesC compiler exits with a parse error before a line
that looks like
void foo(char bar);
which is the prototype of the C function that I want to call as it is
declared in the header file. Can you give me any advice as to how to what
might be causing this error?
Thanks,
-Mat
----------------
Yes, you can make calls to C functions from nesC code. You don't need to
use
the C,spontaneous attribute if you place your C code in a .c file and
compile
with the appropriate gcc compiler. IMHO, it's easiest to then bundle the
object files into a library file (.a), and reference it from your nesC
Makefile via:
LDFLAGS += path/to/your/libfile.a
Your C library will require a header file to provide function prototypes and
other definitions for code using your library, so you'll also need to tell
your nesC build where to find that header:
CFLAGS += -Ipath/to/your/include/dir
Then, all you have to do in a nesC component which wishes to use functions
exported from your libfile.a is to #include the prototype header and call
the
functions directly.
All the best,
Steve
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help