Hi,
I'm trying to create an own MessageQ_Msg like structure. As mentioned in the Documentation I add the MessageQ_MsgHeader structure at the beginning
struct I2CTaskMsg
{
MessageQ_MsgHeader header;
I2CTaskMsg_TRX trx;
UInt8 slave_addr;
UInt8* pTXData;
UInt8* pRXData;
UInt8 numTXData;
Uint8 numRXData;
};
typedef struct I2CTaskMsg I2CTaskMsg_t;
The next thing I try to do is allocating the message. As mentioned in the documentation and in http://e2e.ti.com/support/embedded/f/355/t/106813.aspx as size argument I use the size of the structure which gives me the first compiler error. In the url above it is told that one should cast (I think to the MessageQ_Msg struct or vice versa to my own Message struct). Yet casting gives me compiler errors as well.
I2CTaskMsg_t msg;
msg = (I2CTaskMsg_t)MessageQ_alloc(HEAPID, sizeof(I2CTaskMsg_t));
"../src/dummyTask.c", line 15: error: cast to type "I2CTaskMsg_t" is not allowed
if ((MessageQ_Msg)msg == NULL)
{
//error
}
// set own Queue as ReplyQueue for Message
MessageQ_setReplyQueue(dummyTask_MessageQ, (MessageQ_Msg)msg);
"../src/dummyTask.c", line 16: error: invalid type conversion
"../src/dummyTask.c", line 21: error: invalid type conversion
Any explanation what I'm doing wrong, or even better some source code telling me how to do this. since at least the user manual or cdoc/doxygen don't tell much about this.
Thanks
Stefan