Tomo,

I went through this a few weeks back, but I went a different direction. I write and compile my C code as separate .c files, rather than including them in a .nc file. That way, I don't have to take any special precautions to insure that I don't have overlapping variable names, etc. To do a build, I just compile the .c files separately and include the .o files in the link. I got the details of doing this from help on this forum, but it's actually very simple.

These three steps work for me:
1) For compiling: msp430-gcc.exe -c *.c
2) For linking: Add '*.o' to the end of the PFLAGS setting in file /opt/tinyos-1.x/tools/make/msp/msp.rules 3) To expose a function name in a .nc file so it's visible from a .c file, or vice versa, add the '__attribute__((C, spontaneous))' qualifier on a function definition.

This approach has worked great. I have a fairly sizable application, 90% of which is in .c files. I compile and test under native Linux before moving to the less friendly mote world. That keeps my mote test time to a minimum.

Ron Olson


Hi,

I'm using c-written subroutines for programs on TinyOS. Subroutine definition files (xxx.c) are combined to .nc files using "#include" and "includes". So far this approach has been working, but I couldn't find supporting document for this approach. Is there any drawback of using c-written subroutines on TinyOS?

Thank you

Tomo

Tomonori NAGAYAMA

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to