17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PreProcessor<br />

Examples:<br />

#USE TOUCHPAD (THRESHOLD=5, PIN_D5='5', PIN_B0='C')<br />

void main(void){<br />

char c;<br />

enable_interrupts(GLOBAL);<br />

while(1){<br />

c = TOUCHPAD_GETC(); //will wait until a pin is detected<br />

} //if PIN_B0 is pressed, c will have 'C'<br />

} //if PIN_D5 is pressed, c will have '5'<br />

Example None<br />

Files:<br />

Also See: touchpad_state( ), touchpad_getc( ), touchpad_hit( )<br />

#warning<br />

Syntax:<br />

Elements:<br />

Purpose:<br />

#WARNING text<br />

text is optional and may be any text<br />

Forces the compiler to generate a warning at the location this directive<br />

appears in the file. The text may include macros that will be expanded<br />

for the display. This may be used to see the macro expansion. The<br />

command may also be used to alert the user to an invalid compile time<br />

situation.<br />

To prevent the warning from being counted as a warning, use this<br />

syntax: #warning/information text<br />

Examples:<br />

#if BUFFER_SIZE < 32<br />

#warning Buffer Overflow may occur<br />

#endif<br />

Example Files:<br />

Also See:<br />

ex_psp.c<br />

#ERROR<br />

#word<br />

Syntax:<br />

Elements:<br />

#WORD id = x<br />

id is a valid C identifier,<br />

149

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

Saved successfully!

Ooh no, something went wrong!