From: mmaroti Date: Tue, 13 Apr 2010 20:27:05 +0000 (+0000) Subject: added more documentation to the getTime32 function X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=d04aacb17477664b6c742a36b964f745d15533da;p=tinyos-2.x.git added more documentation to the getTime32 function --- 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); } /**