]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
remove left adjustment
authoridgay <idgay>
Thu, 8 Feb 2007 17:52:32 +0000 (17:52 +0000)
committeridgay <idgay>
Thu, 8 Feb 2007 17:52:32 +0000 (17:52 +0000)
fix bug in ReadStream (only 1st request worked)

tos/chips/atm128/adc/AdcP.nc
tos/chips/atm128/adc/AdcStreamP.nc
tos/chips/cc1000/CC1000RssiP.nc

index afb58823c2862a813c2735b17291775ae9fcf940..fa918c7f1a93079986c63d1e05046948df6f164b 100644 (file)
@@ -80,7 +80,7 @@ implementation {
   }
 
   void sample() {
-    call Atm128AdcSingle.getData(channel(), refVoltage(), TRUE, prescaler());
+    call Atm128AdcSingle.getData(channel(), refVoltage(), FALSE, prescaler());
   }
 
   error_t startGet(uint8_t newState, uint8_t newClient) {
index 1db0bfe1d2a8e45255e38c9a7e8c6f075354198b..9435c30f2a39bf93ed29dc8f9aa2438f6443767c 100644 (file)
@@ -100,7 +100,7 @@ implementation {
   }
 
   void sample() {
-    call Atm128AdcSingle.getData(channel(), refVoltage(), TRUE, prescaler());
+    call Atm128AdcSingle.getData(channel(), refVoltage(), FALSE, prescaler());
   }
 
   command error_t ReadStream.postBuffer[uint8_t c](uint16_t *buf, uint16_t n) {
@@ -123,6 +123,12 @@ implementation {
     uint8_t c = client;
     uint32_t actualPeriod = call Atm128Calibrate.actualMicro(period);
 
+    atomic
+      {
+       bufferQueue[c] = NULL;
+       bufferQueueEnd[c] = &bufferQueue[c];
+      }
+
     client = NSTREAM;
     signal ReadStream.readDone[c](SUCCESS, actualPeriod);
   }
index 275bb2f876fc49851f5713b6f2b2c26e514f686f..ee6ccd087df5b5a183fd9e96881d58cd5c6078bd 100644 (file)
@@ -100,9 +100,8 @@ implementation
   async event void ActualRssi.readDone(error_t result, uint16_t data) {
     atomic
       {
-       /* The code assumes that RSSI measurements are 10-bits 
-          (legacy effect) */
-       signal Rssi.readDone[currentOp](result, data >> 6);
+       /* The RSSI measurements are assumed to be 10-bits */
+       signal Rssi.readDone[currentOp](result, data);
        startNextOp();
       }
   }