CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

My program is not looping.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
shoyur



Joined: 18 Oct 2008
Posts: 6

View user's profile Send private message

My program is not looping.
PostPosted: Sat Oct 18, 2008 9:46 pm     Reply with quote

Question

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

View user's profile Send private message

PostPosted: Sat Oct 18, 2008 10:38 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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