X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fplatforms%2Fmulle%2FDemoSensorC.nc;h=3c88114e9381dec329b6d9e209c124c310e7b9ed;hb=3a993e16707c4fde0d1df1f2826205563ca980e1;hp=568bb9ed79ef082289d4daab317e479c28d79e9c;hpb=e3b86016fda95d4e54e2909f05dba41ca8461e16;p=tinyos-2.x.git diff --git a/tos/platforms/mulle/DemoSensorC.nc b/tos/platforms/mulle/DemoSensorC.nc index 568bb9ed..3c88114e 100755 --- a/tos/platforms/mulle/DemoSensorC.nc +++ b/tos/platforms/mulle/DemoSensorC.nc @@ -35,29 +35,28 @@ */ /** - * A dumb demo sensor used for testing. + * Demo sensor that connects to the AN0 channel on the MCU. This can + * easily be used together with the potentiometer on the Mulle + * expansionboard. * * @author Henrik Makitaavola */ -generic module DemoSensorC() +generic configuration DemoSensorC() { provides interface Read; } implementation { - uint8_t counter = 0; - - task void signalReadDone() - { - atomic uint8_t tmp = counter; - atomic counter++; - - signal Read.readDone(SUCCESS, tmp); - } - - command error_t Read.read() - { - return SUCCESS; - } - default event void Read.readDone( error_t result, uint16_t val ) {} + components new AdcReadClientC(), DemoSensorP, + HplM16c62pGeneralIOC as IOs, + RealMainP; + + DemoSensorP.Pin -> IOs.PortP100; + DemoSensorP.AVcc -> IOs.PortP76; + + Read = AdcReadClientC; + + AdcReadClientC.M16c62pAdcConfig -> DemoSensorP; + + RealMainP.PlatformInit -> DemoSensorP; }