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

Indirect function calls with code banking

Hi,

Im having some problems with code banking, regarding to passing functions adresses as parameters. for example:

void func ( void(*ret_func1)(void), void(*ret_func2)(void))
{
.
.
.
if(x)
(*ret_func1)();
if(y)
(*ret_func2)();
.
.
.
}

Imagine that several functions (placed on all banks) call the function "func" and pass the 2 return adresses, that are on diferent banks that "func".
It makes my program halt or reset(depending on the situation).

How can i make this work?
Im using c51 v7.03, and a silabs 8051F120 processor.

thanks for any help,

Eduardo.