[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/ftsp TimeSyncP.nc, 1.5, 1.6

kusy kusy at users.sourceforge.net
Mon Mar 16 15:51:20 PDT 2009


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/ftsp
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4553

Modified Files:
	TimeSyncP.nc 
Log Message:
fixed bug in addNewEntry noticed by Phil (https://www.millennium.berkeley.edu/pipermail/tinyos-devel/2009-March/003710.html)

Index: TimeSyncP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/ftsp/TimeSyncP.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TimeSyncP.nc	17 Feb 2009 17:49:15 -0000	1.5
--- TimeSyncP.nc	16 Mar 2009 22:51:18 -0000	1.6
***************
*** 228,233 ****
          int32_t timeError;
  
-         tableEntries = 0;
- 
          // clear table if the received entry's been inconsistent for some time
          timeError = msg->localTime;
--- 228,231 ----
***************
*** 239,246 ****
              if (++numErrors>3)
                  clearTable();
          }
-         else
-             numErrors = 0;
  
  
          for(i = 0; i < MAX_ENTRIES; ++i) {
--- 237,245 ----
              if (++numErrors>3)
                  clearTable();
+             return; // don't incorporate a bad reading
          }
  
+         tableEntries = 0; // don't reset table size unless you're recounting
+         numErrors = 0;
  
          for(i = 0; i < MAX_ENTRIES; ++i) {



More information about the Tinyos-2-commits mailing list