X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=tos%2Fchips%2Fcc2420%2Ftransmit%2FCC2420TransmitP.nc;fp=tos%2Fchips%2Fcc2420%2Ftransmit%2FCC2420TransmitP.nc;h=f1f47d0ae0e76474617aaf04e439b91752dac278;hb=d04aacb17477664b6c742a36b964f745d15533da;hp=79250cf34817aef8b151c56561c9cda38289f3e6;hpb=42c536d3376434538d66d1b475b8a216e9abd086;p=tinyos-2.x.git diff --git a/tos/chips/cc2420/transmit/CC2420TransmitP.nc b/tos/chips/cc2420/transmit/CC2420TransmitP.nc index 79250cf3..f1f47d0a 100644 --- a/tos/chips/cc2420/transmit/CC2420TransmitP.nc +++ b/tos/chips/cc2420/transmit/CC2420TransmitP.nc @@ -255,13 +255,13 @@ implementation { async command void RadioBackoff.setCca(bool useCca) { } - - inline uint32_t getTime32(uint16_t time) + // this method converts a 16-bit timestamp into a 32-bit one + inline uint32_t getTime32(uint16_t captured_time) { - uint32_t recent_time = call BackoffTimer.getNow(); + uint32_t now = call BackoffTimer.getNow(); - // time is always in the past - return recent_time - (uint16_t)(recent_time - time); + // the captured_time is always in the past + return now - (uint16_t)(now - captured_time); } /**