]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
add support for IRIS (it was CC2420 specific)
authormmaroti <mmaroti>
Sat, 27 Mar 2010 22:03:27 +0000 (22:03 +0000)
committermmaroti <mmaroti>
Sat, 27 Mar 2010 22:03:27 +0000 (22:03 +0000)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/

apps/IPBaseStation/BaseStationC.nc
apps/IPBaseStation/BaseStationP.nc
apps/IPBaseStation/Reset.h

index 8c53be0a541c47ac518c554dc2640d2f6ba809bb..cbb067a965e02493a7a21ad4196489382de4b7fb 100644 (file)
@@ -133,6 +133,10 @@ implementation {
   components IPAddressC;
   BaseStationP.IPAddress -> IPAddressC;
 
+#ifdef PLATFORM_IRIS
+  BaseStationP.RadioChannel -> Radio;
+#else
   components CC2420ControlC;
   BaseStationP.CC2420Config -> CC2420ControlC;
+#endif
 }
index 71645ca91c5b13added1f2782e98e0eb3cc6ed09..0a27e04ecf9c8e94346dd53ca50f5e5bac76c68f 100644 (file)
@@ -65,7 +65,6 @@
  */
 
 #ifndef SIM
-#include "CC2420.h"
 #endif
 #include "AM.h"
 #include "Serial.h"
@@ -95,7 +94,12 @@ module BaseStationP {
 
     interface PacketLink;
     interface LowPowerListening;
+
+#ifdef PLATFORM_IRIS
+    interface RadioChannel;
+#else
     interface CC2420Config;
+#endif
 
     interface Leds;
 
@@ -410,10 +414,16 @@ implementation
     case CONFIG_ECHO:
       break;
     case CONFIG_SET_PARM:
+#ifdef PLATFORM_IRIS
+      // we should check the return value, hope it works
+      call RadioChannel.setChannel(cmd->rf.channel);
+      call IPAddress.setShortAddr(cmd->rf.addr);
+#else
       call CC2420Config.setChannel(cmd->rf.channel);
       // IPAddress calls sync() for you, I think, so we'll put it second 
       call IPAddress.setShortAddr(cmd->rf.addr);
       call CC2420Config.sync();
+#endif
       radioRetries = cmd->retx.retries;
       radioDelay   = cmd->retx.delay;
       break;
@@ -430,10 +440,12 @@ implementation
     return msg;
   }
 
-
+#ifdef PLATFORM_IRIS
+  event void RadioChannel.setChannelDone() { }
+#else
   event void CC2420Config.syncDone(error_t error) {
-
   }
+#endif
 
   event void ConfigureSend.sendDone(message_t *msg, error_t error) {
     echo_busy = FALSE;
index 59951ef3da739e95f66337177852517a69e56bee..550d5c298885a646946449604e4c49dbb3377fb4 100644 (file)
@@ -44,7 +44,7 @@
 
 void resetMote()
 {
-#if defined(PLATFORM_MICA) || defined(PLATFORM_MICA2) || defined(PLATFORM_MICA2DOT) || defined(PLATFORM_MICAZ)
+#if defined(PLATFORM_MICA) || defined(PLATFORM_MICA2) || defined(PLATFORM_MICA2DOT) || defined(PLATFORM_MICAZ) || defined(PLATFORM_IRIS)
        cli(); 
        wdt_enable(0); 
        while (1) {