[Tinyos-2-commits] CVS: tinyos-2.x/tos/platforms/eyesIFX TimeSyncMessageP.nc, 1.1, 1.2 TimeSyncMessageC.nc, 1.1, 1.2 PacketStampP.nc, 1.1, 1.2 PacketStampC.nc, 1.1, 1.2 LocalTimeP.nc, 1.5, 1.6

akoepke andreaskoepke at users.sourceforge.net
Wed Jul 9 05:48:46 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30435

Modified Files:
	TimeSyncMessageP.nc TimeSyncMessageC.nc PacketStampP.nc 
	PacketStampC.nc LocalTimeP.nc 
Log Message:
be more careful with conversion


Index: TimeSyncMessageP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/TimeSyncMessageP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TimeSyncMessageP.nc	9 Jul 2008 10:00:21 -0000	1.1
--- TimeSyncMessageP.nc	9 Jul 2008 12:48:43 -0000	1.2
***************
*** 44,47 ****
--- 44,48 ----
          interface AMSend as SubSend[am_id_t id];
          interface AMPacket;
+         interface LocalTime<TMilli> as LocalTimeMilli;
      }
  }
***************
*** 112,116 ****
      
      command uint32_t TimeSyncPacketMilli.eventTime(message_t* msg) {
!         return (getMetadata(msg)->time / 32);
      };
  
--- 113,119 ----
      
      command uint32_t TimeSyncPacketMilli.eventTime(message_t* msg) {
!         uint32_t now = call LocalTimeMilli.get();
!         uint32_t delay = (now * 32) - (getMetadata(msg)->time);
!         return now - (delay / 32);
      };
  

Index: TimeSyncMessageC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/TimeSyncMessageC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TimeSyncMessageC.nc	9 Jul 2008 10:00:40 -0000	1.1
--- TimeSyncMessageC.nc	9 Jul 2008 12:48:43 -0000	1.2
***************
*** 52,56 ****
      components TimeSyncMessageP as TS;
      components ActiveMessageC as AM;
! 
      SplitControl = AM;
  
--- 52,57 ----
      components TimeSyncMessageP as TS;
      components ActiveMessageC as AM;
!     components LocalTimeC as LT;
!     
      SplitControl = AM;
  
***************
*** 65,68 ****
--- 66,70 ----
      TS.SubSend -> AM.AMSend;
      TS.AMPacket -> AM.AMPacket;
+     TS.LocalTimeMilli -> LT;
  
      TimeSyncAMSend32khz       = TS;

Index: PacketStampP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/PacketStampP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PacketStampP.nc	9 Jul 2008 10:00:42 -0000	1.1
--- PacketStampP.nc	9 Jul 2008 12:48:43 -0000	1.2
***************
*** 35,38 ****
--- 35,41 ----
          interface PacketTimeStamp<TMilli, uint32_t> as PacketTimeStampMilli;
      }
+     uses {
+         interface LocalTime<TMilli> as LocalTimeMilli;
+     }
  }
  implementation  {
***************
*** 48,52 ****
          getMetadata(msg)->time = value;
      }
-     
      async command bool PacketTimeStampMilli.isValid(message_t* msg) {
          return TRUE;
--- 51,54 ----
***************
*** 55,59 ****
      }
      async command uint32_t PacketTimeStampMilli.timestamp(message_t* msg) {
!         return (getMetadata(msg)->time / 32);
      }
      async command void PacketTimeStampMilli.set(message_t* msg, uint32_t value) {
--- 57,63 ----
      }
      async command uint32_t PacketTimeStampMilli.timestamp(message_t* msg) {
!         uint32_t now = call LocalTimeMilli.get();
!         uint32_t delay = (now * 32) - (getMetadata(msg)->time);
!         return now - (delay / 32);
      }
      async command void PacketTimeStampMilli.set(message_t* msg, uint32_t value) {

Index: PacketStampC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/PacketStampC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PacketStampC.nc	9 Jul 2008 10:00:42 -0000	1.1
--- PacketStampC.nc	9 Jul 2008 12:48:43 -0000	1.2
***************
*** 36,41 ****
--- 36,44 ----
  implementation  {
      components PacketStampP as PS;
+     components LocalTimeC as LT;
+     
      PacketTimeStamp32khz = PS;
      PacketTimeStampMilli = PS;
+     PS.LocalTimeMilli -> LT;  
  }
  

Index: LocalTimeP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/LocalTimeP.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** LocalTimeP.nc	9 Jul 2008 10:00:43 -0000	1.5
--- LocalTimeP.nc	9 Jul 2008 12:48:43 -0000	1.6
***************
*** 95,99 ****
      
      async command uint32_t LocalTimeTMilli.get() {
!         return (call LocalTime32kHz.get() / 32);
      }
  }
--- 95,99 ----
      
      async command uint32_t LocalTimeTMilli.get() {
!         return (call WideLocalTime.get() / 32);
      }
  }



More information about the Tinyos-2-commits mailing list