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

Setting PWM, must use 'L'?

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



Joined: 08 Apr 2009
Posts: 9

View user's profile Send private message

Setting PWM, must use 'L'?
PostPosted: Mon Jun 15, 2009 2:10 pm     Reply with quote

I'm looking at some example code and I keep seeing something like this
Code:
set_pwm1_duty(256L);

what does that L do for the value?
also, how would I be able to integrate it into a variable? obviously compiling something like
Code:
int16 value = 256;
set_pwm1_duty(valueL);

does not work. thanks in advanced.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jun 15, 2009 2:12 pm     Reply with quote

See this thread and the links in it.
http://www.ccsinfo.com/forum/viewtopic.php?t=17729&start=12
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Jun 15, 2009 2:48 pm     Reply with quote

Whatever meaningful has been said in the linked threads, it doesn't
change the fact that the below lines produce identical code.
Code:
set_pwm1_duty(256L);
set_pwm1_duty(256);

In contrast, this two are different
Code:
set_pwm1_duty(255L);
set_pwm1_duty(255);

Unfortunately, also the previous threads have some similar (and also inapproriate) examples.
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