I have a function that creates an instance of a structure on the users stack. The structure is called object and it is located at address 0xEFB0.
boolean CAN1_read(ubyte mbx, CAN_MSG *msg) { ubyte newd; TCAN1_Obj object; if ( newd = CAN1_ubNewData(mbx) ) { CAN1_vGetMsgObj(mbx, &object); CAN1_vReleaseObj(mbx); msg->id = object.ulArbitr; msg->size = object.ubMsgCfg >> 4; memcpy(&msg->data[0], &object.ubData[0], msg->size); } return((boolean)newd); }
CAN1_vGetMsgObj(mbx, (TCAN1_Obj huge *)&object);
I had a similar problem with the following piece of code:
static const int OpCodes[][8]= { /* ... */ }; void SomeFunction(int n) { ( (void (*)(void)) (OpCodes[n]) ) (); }
Interesting. This code seems so fundamental that I didn't even consider the possibility that it could be a bug. Does anyone have any ideas for things that I can try to make the code compile correctly without using a huge pointer? -Walt
Maybe switch to the previous version of the compiler? - Mike
View all questions in Keil forum