passing pointer to structure via message box
Posted: Sat Apr 26, 2014 6:38 pm
is this the correct way to pass a pointer to a structure via Message Box ?
Code: Select all
typedef struct
{
char body[64];
char number[14];
}Msg_TypeDef;
void some_func (void)
{
Msg_TypeDef msg;
strcpy(msg.body, "MSG_RECV");
chsnprintf(msg.number,
sizeof(msg.number),
"%d", QueueIndex );
chMBPost(&mbox, (msg_t)&msg, TIME_INFINITE);
}