]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/tmirws/sensors/WindVaneC.nc
Update WindVaneC to use newer underlying code.
[tinyos-2.x.git] / tos / platforms / tmirws / sensors / WindVaneC.nc
index 883021f72e61977ebc0df79f1428b649c91d5a3e..7da5c9a63bba12824f68dac4f752a312569ad5e9 100644 (file)
  */
  
 /**
- * WindVane sensor
+ * WindVane sensor.  The compass is a number of sectors, 0...(sectors - 1).
+ * sectors must be a power of 2.  Sector zero is North, and sectors/2 is South.
+ * Like any compass, the heading increases as one traverses the compass
+ * clockwise.  The number of sectors are contrained by the uint8_t data members
+ * of wind_vane_t to 128.
  * 
  * @author R. Steve McKown <rsmckown@gmail.com>
  */
  
 #include "WindVane.h"
 
-configuration WindVaneC {
-  provides interface ReadRef<wind_vane_t>;
+generic configuration WindVaneC(uint8_t sectors) {
+  provides {
+    interface Get<uint8_t> as Sectors;
+    interface ReadRef<wind_vane_t>;
+  }
 }
 implementation {
-  components WindVaneP;
+  components new WindVaneP(sectors);
+  Sectors = WindVaneP;
   ReadRef = WindVaneP;
 
   components SoftwareRtcC as RtcC;
   WindVaneP.Second -> RtcC;
 
-  components new WindVaneAdcC();
-  WindVaneP.Vane -> WindVaneAdcC.Read;
-
-  components HalWindVaneC;
-  WindVaneP.WPower -> HalWindVaneC;
+  components WindVaneReadC;
+  WindVaneP.Vane -> WindVaneReadC.Read;
 }