pass msg back to main
Posted: Sat Nov 15, 2014 10:11 am
how can one pass a msg back to the main thread.
i.e. how do i get the pointer to main thread so i can post this to the thread doing the work and then wait for the response ?
i.e. how do i get the pointer to main thread so i can post this to the thread doing the work and then wait for the response ?
Code: Select all
int main(void)
{
dongmsg.key = &key;
dongmsg.tp = *******calling thread pointer********;
dongmsg.id = DONG_KEY_REQUEST;
dongmsg.imei = md->manu.imei;
chMBPost( mbox,
( msg_t )&dongmsg,
TIME_INFINITE );
p = chMsgWait();
if( p != NULL )
{
}
}