]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/adc12/AdcReadStreamClientC.nc
- bugfix: ReadStream did not work with a "usPeriod" parameter > 0xFFFF (the fix uses...
[tinyos-2.x.git] / tos / chips / msp430 / adc12 / AdcReadStreamClientC.nc
index 94efef51805cf6f6b44b63f728fea1083594664b..696bf71b3dd6a411e24f31662c8444c05f6cb5ff 100644 (file)
@@ -48,26 +48,24 @@ generic configuration AdcReadStreamClientC() {
   provides interface ReadStream<uint16_t>;
   uses interface AdcConfigure<const msp430adc12_channel_config_t*>;
 } implementation {
-  components AdcP,
+  components WireAdcStreamP, 
 #ifdef REF_VOLT_AUTO_CONFIGURE     
              // if the client configuration requires a stable 
              // reference voltage, the reference voltage generator 
              // is automatically enabled
-             new Msp430Adc12ClientAutoRVGC() as Msp430AdcPlient;
+             new Msp430Adc12ClientAutoRVGC() as Msp430AdcClient;
+  AdcConfigure = Msp430AdcClient.AdcConfigure;
 #else
-             new Msp430Adc12ClientC() as Msp430AdcPlient;
+             new Msp430Adc12ClientC() as Msp430AdcClient;
 #endif
 
   enum {
     RSCLIENT = unique(ADCC_READ_STREAM_SERVICE),
   };
 
-  ReadStream = AdcP.ReadStream[RSCLIENT];
-  AdcConfigure = AdcP.ConfigReadStream[RSCLIENT];
-  AdcP.SingleChannelReadStream[RSCLIENT] -> Msp430AdcPlient.Msp430Adc12SingleChannel;
-  AdcP.ResourceReadStream[RSCLIENT] -> Msp430AdcPlient.Resource;
-#ifdef REF_VOLT_AUTO_CONFIGURE
-  AdcConfigure = Msp430AdcPlient.AdcConfigure;
-#endif
+  ReadStream = WireAdcStreamP.ReadStream[RSCLIENT];
+  AdcConfigure = WireAdcStreamP.AdcConfigure[RSCLIENT];
+  WireAdcStreamP.Resource[RSCLIENT] -> Msp430AdcClient.Resource;
+  WireAdcStreamP.Msp430Adc12SingleChannel[RSCLIENT] -> Msp430AdcClient.Msp430Adc12SingleChannel;
 }