|
|
View previous topic :: View next topic |
Author |
Message |
shoyur
Joined: 18 Oct 2008 Posts: 6
|
My program is not looping. |
Posted: Sat Oct 18, 2008 9:46 pm |
|
|
I have a function1 and a function2 : when the if is true, it goes to function2, when function2 is done, it doesn't go back in the while to continue doing function1 forever (the "do this... line"), even if the while condition is true. I tried with "continue;" or "return;", can't use goto in another function. It doesn't return to my while, even if I put that while in another "while (1) { ... }". Commands in the functions are very simple and not bugged and not other loops.
I can't call function1 in function2 or it says "recursive loop not allowed".
Code: | void function2() {
...
...
...
}
void function1() {
while (something) {
...
...
...
if (something) function2();
do this...
}
} |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Oct 18, 2008 10:38 pm |
|
|
Post a short but complete test program. The program should have
statements for #include, #fuses, #use delay(), main(), etc. Look at
the code in this thread. That's what I mean by a short test program:
http://www.ccsinfo.com/forum/viewtopic.php?t=20607
I realize that you have to put a little bit of code inside the functions
to demonstrate the problem, but keep it as little as possible. |
|
|
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|