I tried to re-call a function. It told me recursion is not permitted any ideas?
With prototype headers
Code:
void start();
void end();
void main();
void start()
{
end();
//It will tell me that recursion is not permitted?
}
void end()
{
}
void main{
}
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
Posted: Sun Nov 14, 2010 3:49 am
Don't use recursion.....
Problem is that the PIC, does not have a data 'stack'. So subroutines can't have temporary variables that go to different locations each time the function is called, without a lot of extra coding. So a routine cannot be called inside another copy of itself - 'no recursion'.
What you post, won't give the error you are talking about. However if you change it so that end contains a call to 'start', it will.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum