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

Embedding Compiler version

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



Joined: 10 Dec 2003
Posts: 70
Location: West Sussex, UK

View user's profile Send private message

Embedding Compiler version
PostPosted: Wed Apr 27, 2005 4:25 am     Reply with quote

Is there a simple way (like the use of the __DATE__ macro) to automatically embed the version of Compiler used to create a particular build, in the final code.
_________________
Peter Willis
Development Director
Howard Eaton Lighting Ltd UK
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Apr 27, 2005 6:16 am     Reply with quote

From the readme.txt

Quote:

The built in function getenv() has been added. The syntax is
value = getenv(cstring);
cstring is a constant string with a recognised keyword
as follows:
FUSE_SET:fffff Returns 1 if fuse fffff is enabled
FUSE_VALID:fffff Returns 1 if fuse fffff is valid
INT:iiiii Returns 1 if the interrupt iiiii is valid
ID Returns the device ID (set by #ID)
DEVICE Returns the device name string (like "PIC16C74")
CLOCK Returns the Osc clock value (from a #USE DELAY)
VERSION Returns the compiler version as a float
VERSION_STRING Returns the compiler version as a string

PROGRAM_MEMORY Returns the size of memory for code (in words)
STACK Returns the stack size
DATA_EEPROM Returns the number of bytes of data EERPOM
READ_PROGRAM Returns a 1 if the code memory can be read
PIN:pb Returns a 1 if bit b on port p is on this part
ADC_CHANNELS Returns the number of A/D channels
ADC_RESOULTION Returns the number of bits returned from READ_ADC()
ICD Returns a 1 if this is being compiled for a ICD
SPI Returns a 1 if the device has SPI
USB Returns a 1 if the device has USB
CAN Returns a 1 if the device has CAN
I2C_SLAVE Returns a 1 if the device has I2C slave H/W
I2C_MASTER Returns a 1 if the device has I2C master H/W
PSP Returns a 1 if the device has PSP
COMP Returns a 1 if the device has a comparator
VREF Returns a 1 if the device has a voltage reference
LCD Returns a 1 if the device has direct LCD H/W
UART Returns the number of H/W UARTs
CCPx Returns a 1 if the device has CCP number x
TIMERx Returns a 1 if the device has TIMER number x
Examples:
#IF getenv("VERSION")<3.050
#ERROR Compiler version too old for this program
#ENDIF


Hope this help,

Humberto
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