]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/adc12/Msp430Adc12ImplP.nc
safe tinyos annotations
[tinyos-2.x.git] / tos / chips / msp430 / adc12 / Msp430Adc12ImplP.nc
index e815ee61e0ef5b1dcd5154fd81843957b6c3e289..a6ac26e6aa80e86c4aac8c1ff9c478662cf15539 100644 (file)
@@ -79,8 +79,9 @@ implementation
 
   uint8_t state;                  /* see enum above */
   
-  uint16_t *resultBuffer;         /* conversion results */
   uint16_t resultBufferLength;    /* length of buffer */
+  uint16_t *COUNT_NOK(resultBufferLength) resultBufferStart;
+  uint16_t *FAT_NOK(resultBufferStart, resultBufferStart+resultBufferLength) resultBuffer;         /* conversion results */
   uint16_t resultBufferIndex;     /* offset into buffer */
   uint8_t numChannels;            /* number of channels (multi-channel conversion) */
   uint8_t clientID;               /* ID of client that called getData() */
@@ -549,6 +550,7 @@ implementation
       case MULTI_CHANNEL:
         {
           uint16_t i = 0, k;
+          resultBufferStart = resultBuffer;
           do {
             *resultBuffer++ = call HplAdc12.getMem(i);
           } while (++i < numChannels);
@@ -566,6 +568,7 @@ implementation
       case MULTIPLE_DATA:
         {
           uint16_t i = 0, length, k;
+          resultBufferStart = resultBuffer;
           if (resultBufferLength - resultBufferIndex > 16) 
             length = 16;
           else
@@ -594,6 +597,7 @@ implementation
       case MULTIPLE_DATA_REPEAT:
         {
           uint8_t i = 0;
+          resultBufferStart = resultBuffer;
           do {
             *resultBuffer++ = call HplAdc12.getMem(i);
           } while (++i < resultBufferLength);