Hi, how do I programm a recursive function? The compiler always puts variables in registers, therefore the function cannot be called recursivly. An other question, how do I put variables in XRAM? With IRAM it works because of the iram specifier. Is there something similar for XRAM? Thanks for help Bert Weber
how do I programm a recursive function Take a look at the reentrant function specifier. Jon
The compiler always puts variables in registers, therefore the function cannot be called recursivly. Wrong. When calling a function, the compiler saves the registers that can be changed by the function on the stack. This way recursion works just fine: the stack grows, local variables don't get overwritten. With IRAM it works because of the iram specifier. Is there something similar for XRAM? Sort of: sdata may do. Any particular reason why you want variables in XRAM as opposed to other RAM in your system? Regards, - mike
View all questions in Keil forum