[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/msp430/adc12 AdcP.nc, 1.5, 1.6 AdcStreamP.nc, 1.1, 1.2 Msp430Adc12ImplP.nc, 1.6, 1.7 Msp430Adc12SingleChannel.nc, 1.4, 1.5

John Regehr regehr at users.sourceforge.net
Tue Jun 3 22:31:17 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/adc12
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv3681/adc12

Modified Files:
	AdcP.nc AdcStreamP.nc Msp430Adc12ImplP.nc 
	Msp430Adc12SingleChannel.nc 
Log Message:
safe tinyos annotations

Index: AdcP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/adc12/AdcP.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** AdcP.nc	7 Apr 2008 09:41:55 -0000	1.5
--- AdcP.nc	4 Jun 2008 05:31:15 -0000	1.6
***************
*** 66,70 ****
    {
      error_t result = EINVAL;
!     const msp430adc12_channel_config_t *config;
      config = call Config.getConfiguration[client]();
      if (config->inch != INPUT_CHANNEL_NONE)
--- 66,70 ----
    {
      error_t result = EINVAL;
!     const msp430adc12_channel_config_t * ONE config;
      config = call Config.getConfiguration[client]();
      if (config->inch != INPUT_CHANNEL_NONE)
***************
*** 160,164 ****
  
    async event uint16_t* SingleChannel.multipleDataReady[uint8_t client](
!       uint16_t *buf, uint16_t length)
    {
      // error !
--- 160,164 ----
  
    async event uint16_t* SingleChannel.multipleDataReady[uint8_t client](
!       uint16_t * COUNT_NOK(length) buf, uint16_t length)
    {
      // error !

Index: AdcStreamP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/adc12/AdcStreamP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AdcStreamP.nc	7 Apr 2008 09:41:55 -0000	1.1
--- AdcStreamP.nc	4 Jun 2008 05:31:15 -0000	1.2
***************
*** 68,78 ****
    struct list_entry_t {
      uint16_t count;
!     struct list_entry_t *next;
    };
    struct list_entry_t *bufferQueue[NSTREAM];
!   struct list_entry_t **bufferQueueEnd[NSTREAM];
!   uint16_t *lastBuffer, lastCount;
  
!   norace uint16_t *buffer, *pos, count;
    norace uint32_t now, period;
    norace bool periodModified;
--- 68,80 ----
    struct list_entry_t {
      uint16_t count;
!     struct list_entry_t * ONE_NOK next;
    };
    struct list_entry_t *bufferQueue[NSTREAM];
!   struct list_entry_t * ONE_NOK * bufferQueueEnd[NSTREAM];
!   uint16_t * ONE_NOK lastBuffer, lastCount;
  
!   norace uint16_t count;
!   norace uint16_t * COUNT_NOK(count) buffer; 
!   norace uint16_t * FAT_NOK(buffer, buffer+count) pos;
    norace uint32_t now, period;
    norace bool periodModified;
***************
*** 97,101 ****
      atomic
      {
!       struct list_entry_t *newEntry = (struct list_entry_t *)buf;
  
        if (!bufferQueueEnd[c]) // Can't post right now.
--- 99,103 ----
      atomic
      {
!       struct list_entry_t * ONE newEntry = TCAST(struct list_entry_t * ONE, buf);
  
        if (!bufferQueueEnd[c]) // Can't post right now.
***************
*** 132,137 ****
  
      atomic entry = bufferQueue[c];
!     for (; entry; entry = entry->next)
!       signal ReadStream.bufferDone[c](FAIL, (uint16_t *)entry, entry->count);
  
      atomic
--- 134,141 ----
  
      atomic entry = bufferQueue[c];
!     for (; entry; entry = entry->next) {
!       uint16_t tmp_count __DEPUTY_UNUSED__ = entry->count;
!       signal ReadStream.bufferDone[c](FAIL, TCAST(uint16_t * COUNT_NOK(tmp_count),entry), entry->count);
!     }
  
      atomic
***************
*** 180,188 ****
        else
        {
          bufferQueue[client] = entry->next;
          if (!bufferQueue[client])
            bufferQueueEnd[client] = &bufferQueue[client];
-         pos = buffer = (uint16_t *)entry;
          count = entry->count;
          if (startNextAlarm)
            nextAlarm();
--- 184,194 ----
        else
        {
+         uint16_t tmp_count;
          bufferQueue[client] = entry->next;
          if (!bufferQueue[client])
            bufferQueueEnd[client] = &bufferQueue[client];
          count = entry->count;
+         tmp_count = count;
+ 	pos = buffer = TCAST(uint16_t * COUNT_NOK(tmp_count), entry);
          if (startNextAlarm)
            nextAlarm();

Index: Msp430Adc12ImplP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/adc12/Msp430Adc12ImplP.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Msp430Adc12ImplP.nc	7 Apr 2008 09:41:55 -0000	1.6
--- Msp430Adc12ImplP.nc	4 Jun 2008 05:31:15 -0000	1.7
***************
*** 80,85 ****
    uint8_t state;                  /* see enum above */
    
-   uint16_t *resultBuffer;         /* conversion results */
    uint16_t resultBufferLength;    /* length of buffer */
    uint16_t resultBufferIndex;     /* offset into buffer */
    uint8_t numChannels;            /* number of channels (multi-channel conversion) */
--- 80,86 ----
    uint8_t state;                  /* see enum above */
    
    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) */
***************
*** 550,553 ****
--- 551,555 ----
          {
            uint16_t i = 0, k;
+           resultBufferStart = resultBuffer;
            do {
              *resultBuffer++ = call HplAdc12.getMem(i);
***************
*** 567,570 ****
--- 569,573 ----
          {
            uint16_t i = 0, length, k;
+           resultBufferStart = resultBuffer;
            if (resultBufferLength - resultBufferIndex > 16) 
              length = 16;
***************
*** 595,598 ****
--- 598,602 ----
          {
            uint8_t i = 0;
+           resultBufferStart = resultBuffer;
            do {
              *resultBuffer++ = call HplAdc12.getMem(i);

Index: Msp430Adc12SingleChannel.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/adc12/Msp430Adc12SingleChannel.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Msp430Adc12SingleChannel.nc	12 Dec 2006 18:23:07 -0000	1.4
--- Msp430Adc12SingleChannel.nc	4 Jun 2008 05:31:15 -0000	1.5
***************
*** 82,86 ****
     * <code>getData()</code> can be called to start the conversion.
     */
!   async command error_t configureSingle(const msp430adc12_channel_config_t *config);
  
    /** 
--- 82,86 ----
     * <code>getData()</code> can be called to start the conversion.
     */
!   async command error_t configureSingle(const msp430adc12_channel_config_t *ONE config);
  
    /** 
***************
*** 104,108 ****
     * <code>getData()</code> can be called to start with the first conversion.
     */
!   async command error_t configureSingleRepeat(const msp430adc12_channel_config_t *config, uint16_t jiffies);
  
    
--- 104,108 ----
     * <code>getData()</code> can be called to start with the first conversion.
     */
!   async command error_t configureSingleRepeat(const msp430adc12_channel_config_t *ONE config, uint16_t jiffies);
  
    
***************
*** 136,140 ****
     * <code>getData()</code> can be called to start with the first conversion.
     */ 
!   async command error_t configureMultiple( const msp430adc12_channel_config_t *config, uint16_t buffer[], uint16_t numSamples, uint16_t jiffies);
  
    /** 
--- 136,140 ----
     * <code>getData()</code> can be called to start with the first conversion.
     */ 
!   async command error_t configureMultiple( const msp430adc12_channel_config_t *ONE config, uint16_t *COUNT(numSamples) buffer, uint16_t numSamples, uint16_t jiffies);
  
    /** 
***************
*** 175,179 ****
     * <code>getData()</code> can be called to start with the first conversion.
     */ 
!   async command error_t configureMultipleRepeat(const msp430adc12_channel_config_t *config, uint16_t buffer[], uint8_t numSamples, uint16_t jiffies);
  
  
--- 175,179 ----
     * <code>getData()</code> can be called to start with the first conversion.
     */ 
!   async command error_t configureMultipleRepeat(const msp430adc12_channel_config_t *ONE config, uint16_t *COUNT(numSamples) buffer, uint8_t numSamples, uint16_t jiffies);
  
  
***************
*** 225,229 ****
     * was configured with <code>configureMultiple()</code>.
     */    
!   async event uint16_t* multipleDataReady(uint16_t buffer[], uint16_t numSamples); 
  
  }
--- 225,229 ----
     * was configured with <code>configureMultiple()</code>.
     */    
!   async event uint16_t * ONE_NOK multipleDataReady(uint16_t *COUNT(numSamples) buffer, uint16_t numSamples); 
  
  }



More information about the Tinyos-2-commits mailing list