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

Output CCS compiler version via printf?

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



Joined: 28 Mar 2014
Posts: 5

View user's profile Send private message

Output CCS compiler version via printf?
PostPosted: Mon May 05, 2014 8:08 am     Reply with quote

Hi all,

is there a way to read the current CCS compiler version in my code? So that I can print it out via e.g. fprintf (to UART for the user's information).

Something like
Quote:
uint8 ucVersionMajor, ucVersionMinor;
GetCompilerVersion(&ucVersionMajor, &ucVersionMinor);
fprintf(COM2, "Version=%d, %d", ucVersionMajor, ucVersionMinor);


Thanks
Jyrki
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Mon May 05, 2014 8:33 am     Reply with quote

Hi,

Yes. Look at the 'GetEnv()' function. This function can return the compiler version as a float.

Code:

value = getenv (version);


John


Last edited by ezflyr on Mon May 05, 2014 8:35 am; edited 2 times in total
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon May 05, 2014 8:34 am     Reply with quote

it always helps to read the manual first Very Happy Very Happy
Jyrki



Joined: 28 Mar 2014
Posts: 5

View user's profile Send private message

PostPosted: Tue May 06, 2014 1:17 am     Reply with quote

Thanks for the fast help.

PS: I searched the online help for keywords like "version" "compiler" etc., but didn't find anything. Maybe CCS can improve the search index.
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Tue May 06, 2014 1:27 am     Reply with quote

This is where the pdf manual helps. Much better for searching....

Though it tends to be a slightly older version, it really is useful to have this on your system, and when you want to find something, without knowing what the 'headword' needed is, a search in this, will often find it.

Best Wishes
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