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.

Functional Overview<br />

be treated as a high priority interrupt.<br />

Relevant Interrupts:<br />

#int_default<br />

#int_global<br />

#int_xxx<br />

This directive specifies that the following function should be called<br />

if an interrupt is triggered but no routine is associated with that<br />

interrupt.<br />

This directive specifies that the following function should be called<br />

whenever an interrupt is triggered. This function will replace the<br />

compiler generated interrupt dispatcher.<br />

This directive specifies that the following function should be called<br />

whenever the xxx interrupt is triggered. If the compiler generated<br />

interrupt dispatcher is used, the compiler will take care of clearing<br />

the interrupt flag bits.<br />

Relevant Include Files:<br />

none, all functions built in.<br />

Relevant getenv()<br />

Parameters:<br />

none<br />

Example Code:<br />

#int_timer0<br />

void timer0interrupt()<br />

// #int_timer associates the following function with the<br />

// interrupt service routine that should be called<br />

enable_interrupts(TIMER0); // enables the timer0 interrupt<br />

disable_interrtups(TIMER0); // disables the timer0 interrupt<br />

clear_interrupt(TIMER0); // clears the timer0 interrupt flag<br />

Low Voltage Detect<br />

These functions configure the high/low voltage detect module. Functions available on the chips<br />

that have the low voltage detect hardware.<br />

Relevant Functions:<br />

setup_low_volt_detect(mode)<br />

Sets the voltage trigger levels and also the mode (below or<br />

above in case of the high/low voltage detect module). The<br />

options vary depending on the chip and are listed in the<br />

device header files.<br />

Relevant Preprocessor:<br />

57

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

Saved successfully!

Ooh no, something went wrong!