Joined: 10 Dec 2003 Posts: 70 Location: West Sussex, UK
Embedding Compiler version
Posted: Wed Apr 27, 2005 4:25 am
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
Posted: Wed Apr 27, 2005 6:16 am
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
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