Hi, As far as I know (it works in my code), the nesc compiler defines PLATFORM_xxx (I have used it for PLATFORM_TELOSB, PLATFORM_MICAZ and PLATFORM_MICA2). I vaguely remember having read somewhere that this is a deprecated feature and should not be used anymore. Anyways, CtpForwardingEngine.h in the TinyOS CTP implementation seems to use various PLATFORM_xxx defines, including PLATFORM_IRIS:
http://tinyos.cvs.sourceforge.net/viewvc/tinyos/tinyos-2.x/tos/lib/net/ctp/CtpForwardingEngine.h?view=markup Cheers, Urs Michael Schippling wrote: > In T1 the platform/harware.h files have a define to prevent > multiple inclusions, e.g.: TOSH_HARDWARE_MICA2, that you might > be able to use if, as I suspect, there is no formal method. > > However the more TOSish way to deal with the problem is to put > platform dependent files in the individual porting directories. > > MS > > Rodriguez Oscar wrote: >> Hello, >> >> I am trying to port my TinyOS 2.0 program, which was designed to work on >> MICAz motes, to IRIS motes. Around 90% of the code is multi-platform, >> but I'm also doing some platform-specific things with the radio chips. >> >> I have clearly identified the sections of code that are >> platform-specific and I have now written code for the IRIS platform. Now >> all I need is a way to detect the platform I'm building for, via >> preprocessor, and conditionally compile the platform-specific code for >> each platform. >> >> However, I have not found a way to reliably detect the platform I'm >> currently building for. I have also checked the manuals, tutorials and >> the mailing list, but have found very few information on how to make >> portable code. >> >> I think that simply adding to support/make/iris.target, something like: >> >> CFLAGS += -DPLATFORM_IRIS >> >> and doing the same for all platforms could solve this problem. >> >> I am, however, not doing this because I would like my code to build with >> the offical version of TinyOS. >> >> Is there a way to check for the platform that I'm building for that I am >> not aware of? If not, I would like to know your comments for this issue. >> >> Best regards, >> >> Oscar Rodriguez _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
