This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

passing function pointers as parameters

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

0