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

I would like #Error (or #?) to print the calculated values

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



Joined: 29 Sep 2006
Posts: 120

View user's profile Send private message

I would like #Error (or #?) to print the calculated values
PostPosted: Sun Dec 16, 2007 9:06 am     Reply with quote

Hi

Does anybody know how to print-out the calculated values and not the complete "filled-in" define?

Calculation below calculates the reload values for timer 1, given some parameters. I want to error print-out when I need to increase the DIV_BY-X and of course to which value...

Regards,
Edwin

----
#define T1_OF 10.250 // requested overflow time
#define Tosc 1000000 // selected main oscillator
#define T1_DIV_BY_X 1 // selected divider
#define T1_Needed_Tics (T1_OF * Tosc / 4 * T1_DIV_BY_X)

#if T1_Needed_Tics >= 65535
#error Need to increase T1_DIV_BY_X to get T1_OF
#error Increase to at least: T1_Needed_Tics / 65535
#error possible dividers: 1,2,4,8
#endif
---
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