Hi. I'm trying to send a message using RTX51, where the message is a pointer to a struct. I'm having trouble with type conversions, and the pointer never comes out correctly on the other side.
This is what i'd like to do:
//TASK1 SOME_STRUCT xdata myStruct; os_send_message(MBX_NUM, &myStruct, 255); ... //TASK2 SOME_STRUCT xdata * pStruct; os_wait(K_MBX+MBX_NUM, 255, pStruct); ...
Of course, this gives me all sorts of type conversion errors. To fix this, i've tried casting the variables going into and coming from the message functions. It gets rid of the type conversion errors, but still doesn't work correctly.
//TASK1 SOME_STRUCT xdata myStruct; os_send_message(MBX_NUM, (int)&myStruct, 255); ... //TASK2 SOME_STRUCT xdata * pStruct; os_wait(K_MBX+MBX_NUM, 255, (word xdata*)pStruct); ...
Does anybody know how I can correctly cast the arguments to make this work? Any other suggestions?