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 support@ccsinfo.com

condition always true.

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



Joined: 17 Aug 2009
Posts: 50

View user's profile Send private message

condition always true.
PostPosted: Sat Oct 17, 2009 3:31 am     Reply with quote

Hey, if i have a for loop, and I need to put in a delay,

so like for(counter=0; counter < X ; counter ++){ do whatever}

why does the maximum value for X have to be 65535? And apart from changing the clock setup, so that each count was longer, is there a way past this?

thanks
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Oct 17, 2009 5:47 am     Reply with quote

If you need a delay, why not using the CCS built-in delay_XX() functions? They are achieving exact delays, considering the clock settings.

Quote:
why does the maximum value for X have to be 65535?

It doesn't. The range depends on the variable type of counter and is different for unsigned/signed int8/int16/int32.
hobby_85



Joined: 17 Aug 2009
Posts: 50

View user's profile Send private message

PostPosted: Sat Oct 17, 2009 7:04 am     Reply with quote

FvM wrote:
If you need a delay, why not using the CCS built-in delay_XX() functions? They are achieving exact delays, considering the clock settings.

Quote:
why does the maximum value for X have to be 65535?

It doesn't. The range depends on the variable type of counter and is different for unsigned/signed int8/int16/int32.


cool. thank you!
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