// 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))
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)
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();