]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/tmirws/sensors/WindVaneC.nc
Move NoMsp430GpioC out of tos/chips/msp430 and into tos/platforms/tmicore
[tinyos-2.x.git] / tos / platforms / tmirws / sensors / WindVaneC.nc
index 2c317596ee7d2e63a9779adbd8b9226294d06af6..b4937fd14a84f84f67bd653a177eaf70342a5b12 100644 (file)
  */
  
 /**
- * WindVane sensor
+ * WindVane sensor.  The compass is a number of sectors, 0...(sectors - 1).
+ * 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 no more than 255.
  * 
  * @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 WindVaneReadC;
+  WindVaneP.Vane -> WindVaneReadC.Read;
 }