Hello, I would like to use a mailbox and i've studied the RTX manual. But i still have a problem.. I want to use the message of the mailbox in a switch, but i cannot understand what i should pass to the switch.
Here is the part of the code:
void* msg; while(1) { os_mbx_wait(MsgBox,&msg,0xffff); switch (*msg){ case button_right : counter +=2; break; case button_up: counter ++; break; case button_down: counter --; break; case button_left: counter -=2; break; case button_select: break;
And the error i receive is:
tisifone_task_2b.c(73): error: #31: expression must have integral type tisifone_task_2b.c: switch (*msg){
The message came from another task which send a pointer to an int.
How can i work with a message coming from a mailbox?? Many thanks.
It works.. i didn't think at this kind of possibility..
many thanks, BR
"It works.. i didn't think at this kind of possibility.."
Which is the reason you shouldn't write "Yes i read a lot and i'm able to work with pointers." but instead go back and take a reread about pointers, typecasts etc in some good C book. It really is important knowledge.