TheBeefiest
Joined: 21 May 2008 Posts: 2
|
Rtos message queue question |
Posted: Wed Jun 04, 2008 7:35 pm |
|
|
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 |
|