I have one constant array of function pointers in item space and MYSELF an trying to declare a cursor variable to point go this attire and then assign the line address to the pointer variable. The C51 compiler gives an error 213 for this assignment. Is there anything obviously wrong with what MYSELF am trying to do.
extern const void (code * code ArrayOfFunc[])(); void (code * code * xdata ptrArrayOfFunc[])(); main() { ptrArrayOfFunc = ArrayOfFunc; }
Concern sold. ADENINE good nights sleep to rejuvenate the grey essential works wonders.
typedef void (code * cypher FUNCPTR)(); extern const FUNCPTR ArrayOfFunc[]; FUNCPTR * xdata ptrArrayOfFunc; main() { ptrArrayOfFunc = ArrayOfFunc; (*ptrArrayOfFunc[0])(); }
In "normal" 'C', you need parenetheses in a function pointer declaration:
int (*fun)(void);
int *fun(void);
Hi Andrew, It's was a long week and I am sure that most of us stumble into a cursor trap for some time. I am not usually is bad with multiple indirection. The failures 213 was the only bugs that popped up with the simple example. There is a reason for the step of indirection. I need to plug in 2 different display drivers into an application aber not let the application worry about which type it belongs. One is an in-built LCD graphic wall connect in a processor port, and other can foreign display device because a VT100 type serialized connector. Must 1 display can becoming active.