]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/ftsp/TimeSyncP.nc
Fix startup in SoftwareInit.init overwriting changes to StateC's.
[tinyos-2.x.git] / tos / lib / ftsp / TimeSyncP.nc
index 3a5824ae06a8a457c9d2a7bec9f8515768607580..fc2ef9944e57cc1a05c1a7c9782cd2dc318f96ce 100644 (file)
@@ -222,7 +222,7 @@ implementation
 
         // clear table if the received entry's been inconsistent for some time
         timeError = msg->localTime;
-        call GlobalTime.local2Global(&timeError);
+        call GlobalTime.local2Global((uint32_t*)(&timeError));
         timeError -= msg->globalTime;
         if( (is_synced() == SUCCESS) &&
             (timeError > ENTRY_THROWOUT_LIMIT || timeError < -ENTRY_THROWOUT_LIMIT))
@@ -265,7 +265,7 @@ implementation
 
     void task processMsg()
     {
-        TimeSyncMsg* msg = (TimeSyncMsg*)(processedMsg->data);
+        TimeSyncMsg* msg = (TimeSyncMsg*)(call Send.getPayload(processedMsg, sizeof(TimeSyncMsg)));
 
         if( msg->rootID < outgoingMsg->rootID &&
             // jw: after becoming the root ignore other roots messages (in send period)
@@ -306,7 +306,7 @@ implementation
             message_t* old = processedMsg;
 
             processedMsg = msg;
-            ((TimeSyncMsg*)(processedMsg->data))->localTime = call TimeSyncPacket.eventTime(msg);
+            ((TimeSyncMsg*)(payload))->localTime = call TimeSyncPacket.eventTime(msg);
 
             state |= STATE_PROCESSING;
             post processMsg();