[Tinyos-2-commits] [tinyos-main] r5764 committed - rfxlink: TestTransmit now supports ucmini

tinyos-main at googlecode.com tinyos-main at googlecode.com
Fri Sep 30 05:25:33 PDT 2011


Revision: 5764
Author:   mmaroti at gmail.com
Date:     Fri Sep 30 05:24:46 2011
Log:      rfxlink: TestTransmit now supports ucmini
http://code.google.com/p/tinyos-main/source/detail?r=5764

Modified:
  /trunk/apps/tests/rfxlink/TestTransmit/Makefile
  /trunk/apps/tests/rfxlink/TestTransmit/README
  /trunk/apps/tests/rfxlink/TestTransmit/RadioDriverConfigP.nc
  /trunk/apps/tests/rfxlink/TestTransmit/TestRadioDriverC.nc
  /trunk/apps/tests/rfxlink/TestTransmit/TestRadioDriverP.nc

=======================================
--- /trunk/apps/tests/rfxlink/TestTransmit/Makefile	Wed Nov 17 14:50:22 2010
+++ /trunk/apps/tests/rfxlink/TestTransmit/Makefile	Fri Sep 30 05:24:46 2011
@@ -1,5 +1,8 @@
  COMPONENT=TestRadioDriverC

+# send every 2 milliseconds
+CFLAGS += -DSEND_INTERVAL=2000
+
  CFLAGS += -I$(TOSDIR)/lib/diagmsg
  CFLAGS += -DDIAGMSG_RECORDED_MSGS=60
  CFLAGS += -DRADIO_DEBUG
=======================================
--- /trunk/apps/tests/rfxlink/TestTransmit/README	Sun Nov 28 09:00:51 2010
+++ /trunk/apps/tests/rfxlink/TestTransmit/README	Fri Sep 30 05:24:46 2011
@@ -3,6 +3,7 @@
  This application sends a very short message (2 bytes) every 2 millisec
  without checking for other traffic. We want to test if the radio driver
  locks up because we want to transmit while receiving another message.
+You can change the sending interval in the makefile.

  It blinks the 0th LED (red) when 256 times RadioSend.send() returns with
  an error. It blinks the 1st LED (green) when 256 times the RadioSend.send()
=======================================
--- /trunk/apps/tests/rfxlink/TestTransmit/RadioDriverConfigP.nc	Sun Dec 26  
14:33:17 2010
+++ /trunk/apps/tests/rfxlink/TestTransmit/RadioDriverConfigP.nc	Fri Sep 30  
05:24:46 2011
@@ -49,6 +49,8 @@
  		interface CC2420XDriverConfig as RadioDriverConfig;
  #elif defined(PLATFORM_UCMINI)
  		interface RFA1DriverConfig as RadioDriverConfig;
+#elif defined(PLATFORM_UCDUAL)
+		interface Si443xDriverConfig as RadioDriverConfig;
  #endif
  	}
  }
@@ -70,10 +72,12 @@
  		return 0;
  	}

+#if ! defined(PLATFORM_UCMINI)
  	async command uint8_t RadioDriverConfig.headerPreloadLength()
  	{
  		return 7;
  	}
+#endif

  	async command bool RadioDriverConfig.requiresRssiCca(message_t* msg)
  	{
=======================================
--- /trunk/apps/tests/rfxlink/TestTransmit/TestRadioDriverC.nc	Thu Dec 30  
14:09:13 2010
+++ /trunk/apps/tests/rfxlink/TestTransmit/TestRadioDriverC.nc	Fri Sep 30  
05:24:46 2011
@@ -86,6 +86,9 @@
  #elif defined(PLATFORM_UCMINI)
  	components RFA1DriverLayerC as RadioDriverLayerC;
  	components RFA1RadioP as RadioP;
+#elif defined(PLATFORM_UCDUAL)
+	components Si443xDriverLayerC as RadioDriverLayerC;
+	components Si443xRadioP as RadioP;
  #endif

  	components RadioDriverConfigP;
@@ -95,5 +98,7 @@
  	RadioDriverLayerC.TransmitPowerFlag ->  
MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)];
  	RadioDriverLayerC.RSSIFlag ->  
MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)];
  	RadioDriverLayerC.TimeSyncFlag ->  
MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)];
+#if !defined(PLATFORM_UCMINI)
  	RadioDriverLayerC.RadioAlarm ->  
RadioAlarmC.RadioAlarm[unique(UQ_RADIO_ALARM)];
-}
+#endif
+}
=======================================
--- /trunk/apps/tests/rfxlink/TestTransmit/TestRadioDriverP.nc	Sun Dec 26  
14:50:39 2010
+++ /trunk/apps/tests/rfxlink/TestTransmit/TestRadioDriverP.nc	Fri Sep 30  
05:24:46 2011
@@ -92,18 +92,23 @@
  		call RadioAlarm.wait(1);
  	}

-	tasklet_norace uint16_t next;
+	tasklet_norace tradio_size next;

  	tasklet_async event void RadioAlarm.fired()
  	{
  		uint8_t *payload;
  		error_t error;
-
-		next += 2000 * RADIO_ALARM_MICROSEC;
+		int32_t delay;
+
+		next += SEND_INTERVAL * RADIO_ALARM_MICROSEC;
  		atomic
  		{
-			call RadioAlarm.wait(next - call RadioAlarm.getNow());
-		}
+			delay = next - call RadioAlarm.getNow();
+			if( delay <= 0 )
+				delay = 1;
+			call RadioAlarm.wait(delay);
+		}
+		RADIO_ASSERT( delay > 1 );

  		payload = ((void*)&msgbuffer) + call  
RadioPacket.headerLength(&msgbuffer);



More information about the Tinyos-2-commits mailing list