Hi, I have written a simple 8051-application using uVision2 V2.37. I have defined a function which expects a pointer to a function which is then saved in an array of function pointers: int registerFunction( void (*Fct) (void) ) { .... functArray[i] = Fct; .... } calling the function "(*functArray[i])()" fails. As far as I have heard when passing any kind of pointers as parameters the keyowrd "xdata" have to be used in the declaration and the definition of the functions: int foo(int* xdata var); I have tried to use "xdata" in my function declaration, but the compiler did not allow that. Does anybody know how to pass a function pointer as a parameter ?? Best regards hammoud
The following application note coveres everything you must know about function pointers and the C51 Compiler. http://www.keil.com/appnotes/docs/apnt_129.asp Jon
Be not deceived. The title read "tips and techniques for using them effectively in your 8051" there is no such thing. Imp0lementing function pointers in a '51 is an acrobatic circus act. ONCE MORE: the '51 is not a PC. Erik