]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/adc12/HplAdc12P.nc
The bugfix of Apr 18 introduced a new problem that is now fixed.
[tinyos-2.x.git] / tos / chips / msp430 / adc12 / HplAdc12P.nc
index 6243739d775ca7628424a3a20dbafa77e7b5596e..54c9c3464511c7b7d7668c88bd2ed470cf08051b 100644 (file)
@@ -44,7 +44,6 @@
 
 module HplAdc12P {
   provides interface HplAdc12;
-  uses interface HplMsp430InterruptSig as SIGNAL_ADC_VECTOR;
 }
 implementation
 {
@@ -108,9 +107,11 @@ implementation
   
   async command void HplAdc12.stopConversion(){
     // stop conversion mode immediately, conversion data is unreliable
+    uint16_t ctl1 = ADC12CTL1;
     ADC12CTL1 &= ~(CONSEQ0 | CONSEQ1);
     ADC12CTL0 &= ~(ADC12SC + ENC); 
-    ADC12CTL0 &= ~(ADC12ON); 
+    ADC12CTL0 &= ~(ADC12ON);
+    ADC12CTL1 |= (ctl1 & (CONSEQ0 | CONSEQ1));
   }
   
   async command void HplAdc12.enableConversion(){ 
@@ -119,7 +120,7 @@ implementation
     
   async command bool HplAdc12.isBusy(){ return ADC12CTL1 & ADC12BUSY; }
 
-  inline async event void SIGNAL_ADC_VECTOR.fired() {
+  TOSH_SIGNAL(ADC_VECTOR) {
     signal HplAdc12.conversionDone(ADC12IV);
   }
 }