17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PREPROCESSOR<br />

PRE-PROCESSOR DIRECTORY<br />

Pre-processor directives all begin with a # and are followed by a specific command. Syntax is<br />

dependent on the command. Many commands do not allow other syntactical elements on the<br />

remainder of the line. A table of commands and a description is listed on the previous page.<br />

Several of the pre-processor directives are extensions to standard C. C provides a preprocessor<br />

directive that compilers will accept and ignore or act upon the following data. This<br />

implementation will allow any pre-processor directives to begin with #PRAGMA. To be<br />

compatible with other compilers, this may be used before non-standard features.<br />

Examples:<br />

Both of the following are valid<br />

#INLINE<br />

#PRAGMA INLINE<br />

Standard<br />

C<br />

#IF expr #DEFINE #LIST<br />

#IFDEF #UNDEF #NOLIST<br />

#IFNDEF #INCLUDE #PRAGMA<br />

#ELSE #WARNING #ERROR<br />

#ELIF #ENDIF DEFINEDINC<br />

Function<br />

Qualifier<br />

Pre-<br />

Defined<br />

Identifier<br />

RTOS #TASK<br />

Device<br />

Specification<br />

Built-in<br />

Libraries<br />

#INLINE #INT_xxxx #INT_GLOBAL<br />

#SEPARATE<br />

#INT_DEFAULT<br />

a<br />

__DATE_ _ __LINE_ _ __<strong>PCH</strong>_ _<br />

__DEVICE_ _ __FILENAME_ _ __<strong>PCM</strong>_ _<br />

__FILE_ _ __TIME__ __<strong>PCB</strong>_ _<br />

__ADDRESS__<br />

#USE RTOS<br />

#DEVICE chip #ID "filename" #HEXCOMMENT<br />

#FUSES #ID number #ID CHECKSUM<br />

#SERIALIZE #PIN_SELECT a<br />

#USE DELAY #USE FIXED_IO #USE RS232<br />

#USE FAST_IO #USE I2C #USE STANDARD_IO<br />

#USE SPI<br />

#USE TOUCHPAD<br />

#USE TIMER<br />

#USE CAPTURE a a<br />

Memory #ASM #ENDASM #ROM<br />

83

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!