X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tos%2Fchips%2Fcc2420%2Ftransmit%2FCC2420TransmitP.nc;h=79250cf34817aef8b151c56561c9cda38289f3e6;hb=42c536d3376434538d66d1b475b8a216e9abd086;hp=87898e2c5d759adf32ad320a21f17b3b93db7571;hpb=b763fcedb235d2e100c25b0accc15d917880c3e0;p=tinyos-2.x.git 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); } /**