|
Re: Recursion?
The stack size is actually 31 words, not 32 bytes, but the principle is the same. Also keep in mind that you probably can't do the full 31 calls since chances are the initial call to your recursive function already had some stuff on the stack. For example, in the following sequence of calls, 3 stack frames are already used before it even gets to the recursive method. Also, be careful when using interrupts, since an interrupt will also push a frame onto the stack, and if you've already used up the entire stack with recursive calls, you'll get a stack overflow exception.
int main(){
user_code();
}
void user_code(){
doAuto();
}
void doAuto(){
recursiveFn();
}
void recursiveFn(){
recursiveFn();
}
|