From: mmaroti Date: Mon, 12 Apr 2010 09:21:20 +0000 (+0000) Subject: change the time stamp calculation to never round up into the future X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=42c536d3376434538d66d1b475b8a216e9abd086;p=tinyos-2.x.git change the time stamp calculation to never round up into the future (see the discussin with Steve McKown in tinyos-devel on 02/22/09) Committed on the Free edition of March Hare Software CVSNT Server. Upgrade to CVS Suite for more features and support: http://march-hare.com/cvsnt/ --- diff --git a/tos/chips/cc2420/transmit/CC2420TransmitP.nc b/tos/chips/cc2420/transmit/CC2420TransmitP.nc index 87898e2c..79250cf3 100644 --- a/tos/chips/cc2420/transmit/CC2420TransmitP.nc +++ b/tos/chips/cc2420/transmit/CC2420TransmitP.nc @@ -258,8 +258,10 @@ implementation { inline uint32_t getTime32(uint16_t time) { - uint32_t recent_time=call BackoffTimer.getNow(); - return recent_time + (int16_t)(time - recent_time); + uint32_t recent_time = call BackoffTimer.getNow(); + + // time is always in the past + return recent_time - (uint16_t)(recent_time - time); } /**