CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Rtos message queue question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
TheBeefiest



Joined: 21 May 2008
Posts: 2

View user's profile Send private message

Rtos message queue question
PostPosted: Wed Jun 04, 2008 7:35 pm     Reply with quote

Is there anyway to tell from the list file where the RTOS saves message queue bytes? I would like to see as they are changed in memory, i am only getting the first 2 characters properly, then the last 3 which should be zero, are not zero.

Or is there something wrong with writing multiple bytes, and reading them out sequentially?

This is how I send the bytes
Code:

rtos_msg_send(SendDataToAnt, ANT_assign[0]);
         rtos_msg_send(SendDataToAnt, ANT_assign[1]);
         rtos_msg_send(SendDataToAnt, ANT_assign[2]);
         rtos_msg_send(SendDataToAnt, ANT_assign[3]);
         rtos_msg_send(SendDataToAnt, ANT_assign[4]);
         rtos_yield();  //next task


This is how I am receiving them:
Code:

if (rtos_msg_poll()) {
      //we have data
     
      //todo we are not getting the proper bytes from rtos_msg_read()
     
      rtos_wait(semTX); //wait for transmit buffer availability
   
      Txbuff.AntSync = MESG_TX_SYNC; //always this sync
      Txbuff.AntDataLen = rtos_msg_read();
      Txbuff.AntMessId = rtos_msg_read();
      TxBuff.AntChecksum = MESG_TX_SYNC ^ Txbuff.AntDataLen ^ Txbuff.AntMessId;
      for (count=0; count < Txbuff.AntDataLen; count++) {
         //all the data
         Txbuff.AntData[count] = rtos_msg_read();
         TxBuff.AntChecksum ^= Txbuff.AntData[count];
      }
     
      rtos_signal(semTX);  //done using buffer
     
      rtos_msg_send(AsynchTransmit, MSG_START_TX); //tell transmitter to start send
     
      rtos_yield();  //next task
     
   }


When calling rtos_msg_read() in the for loop above, i am not getting the same bytes I put in previously.

Compiler version is pcwh 4.073, and the receiving task has a queue=11 (only 5 bytes being sent in this case)

Also testing results show rtos_msg_poll() returns 5, so i am sure the 5 bytes were sent in. I am not sure where they are in ram to confirm exactly what is being sent in, but i know the values of ANT_assign for sure
Matro
Guest







PostPosted: Thu Jun 05, 2008 9:01 am     Reply with quote

The first parameter of rtos_msg_send() is the name of the function that receives the message.
Is that the case?

Matro.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group