X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Fplatforms%2Ftmirws%2Fsensors%2FWindVaneC.nc;h=7da5c9a63bba12824f68dac4f752a312569ad5e9;hp=883021f72e61977ebc0df79f1428b649c91d5a3e;hb=d77247da5b155b1653e5044fe59ece639dce90bd;hpb=0af086c5bf6a9038446bb804d9a463fd32b4aa77 diff --git a/tos/platforms/tmirws/sensors/WindVaneC.nc b/tos/platforms/tmirws/sensors/WindVaneC.nc index 883021f7..7da5c9a6 100644 --- a/tos/platforms/tmirws/sensors/WindVaneC.nc +++ b/tos/platforms/tmirws/sensors/WindVaneC.nc @@ -28,26 +28,31 @@ */ /** - * 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 */ #include "WindVane.h" -configuration WindVaneC { - provides interface ReadRef; +generic configuration WindVaneC(uint8_t sectors) { + provides { + interface Get as Sectors; + interface ReadRef; + } } 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; }