]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/tmirws/sensors/WindVaneReadC.nc
Address possible dead zone discontinuities when reading in WindVaneReadP.
[tinyos-2.x.git] / tos / platforms / tmirws / sensors / WindVaneReadC.nc
index 3b467349d722b85afad20ea5b8d3091e76b98bc0..98c1bfeb0132bf1501ca8e9cd7851825d0081cc3 100644 (file)
@@ -28,7 +28,8 @@
  */
  
 /**
- * Take an instantaneous reading of the wind vane position, in degrees.
+ * Take an instantaneous reading of the wind vane position as a 10 bit unsigned
+ * value.
  * 
  * @author R. Steve McKown <smckown@gmail.com>
  */
@@ -37,12 +38,13 @@ configuration WindVaneReadC {
   provides interface Read<uint16_t>;
 }
 implementation {
-  components WindVaneReadP;
+  enum { SAMPLES_PER_READ = 4, };
+
+  components new WindVaneReadP(SAMPLES_PER_READ);
   Read = WindVaneReadP;
 
-  components new MultiSampleC(uint16_t, 4);
-  WindVaneReadP.Count -> MultiSampleC;
-  WindVaneReadP.SubRead -> MultiSampleC;
+  components new MultiSampleC(SAMPLES_PER_READ);
+  WindVaneReadP.ReadRef -> MultiSampleC;
 
   components WindVaneAdcP;
   MultiSampleC.AdcConfigure -> WindVaneAdcP;