X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tos%2Fplatforms%2Ftmirws%2Fsensors%2FWindVaneReadC.nc;h=732db2640d909bfe931c1d43de9971ff93c7f77f;hb=a089a3cf9f05aca71a5e22a667c09d9740c2ba94;hp=3b467349d722b85afad20ea5b8d3091e76b98bc0;hpb=924c646126a4cc643fdf90dce88e98e487bcf9eb;p=tinyos-2.x.git diff --git a/tos/platforms/tmirws/sensors/WindVaneReadC.nc b/tos/platforms/tmirws/sensors/WindVaneReadC.nc index 3b467349..732db264 100644 --- a/tos/platforms/tmirws/sensors/WindVaneReadC.nc +++ b/tos/platforms/tmirws/sensors/WindVaneReadC.nc @@ -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 */ @@ -37,12 +38,13 @@ configuration WindVaneReadC { provides interface Read; } 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; @@ -51,6 +53,9 @@ implementation { WindVaneReadP.WPower -> HalWindVaneC.WPower; WindVaneReadP.WDead -> HalWindVaneC.WDead; + components new AverageAngleC(SAMPLES_PER_READ); + WindVaneReadP.Average -> AverageAngleC; + components new StateC(); WindVaneReadP.State -> StateC; }