]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/mica/MeasureClockC.nc
fix rounding in the scale function (see MeasureClockC tinyos-help discussion on feb...
[tinyos-2.x.git] / tos / platforms / mica / MeasureClockC.nc
index 898d80185164097539addb1e8ca649bbf15652bd..5518964d46ff169a7abd9aafdb0f397c740db5e9 100644 (file)
@@ -19,7 +19,7 @@
  * @author David Gay
  */
 
-module MeasureClockC {
+module MeasureClockC @safe() {
   provides {
     /**
      * This code MUST be called from PlatformP only, hence the exactlyonce.
@@ -93,11 +93,11 @@ implementation
   }
 
   async command uint32_t Atm128Calibrate.calibrateMicro(uint32_t n) {
-    return scale32(n + MAGIC / 2, cycles, MAGIC);
+    return scale32(n, cycles, MAGIC);
   }
 
   async command uint32_t Atm128Calibrate.actualMicro(uint32_t n) {
-    return scale32(n + (cycles >> 1), MAGIC, cycles);
+    return scale32(n, MAGIC, cycles);
   }
 
   async command uint8_t Atm128Calibrate.adcPrescaler() {