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 />

Files:<br />

Also See:<br />

enable_interrupts(), disable_interrupts(), #INT_DEFAULT, #INT_GLOBAL, #PRIORITY<br />

#INT_DEFAULT<br />

Syntax:<br />

Elements:<br />

Purpose:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

#INT_DEFAULT<br />

None<br />

The following function will be called if the PIC® triggers an interrupt and<br />

none of the interrupt flags are set. If an interrupt is flagged, but is not the<br />

one triggered, the #INT_DEFAULT function will get called.<br />

#int_default<br />

default_isr() {<br />

printf("Unexplained interrupt\r\n");<br />

}<br />

None<br />

#INT_xxxx, #INT_global<br />

#int_global<br />

Syntax:<br />

#INT_GLOBAL<br />

Elements: None<br />

Purpose: This directive causes the following function<br />

to replace the compiler interrupt<br />

dispatcher. The function is normally not<br />

required and should be used with great<br />

caution. When used, the compiler does<br />

not generate start-up code or clean-up<br />

code, and does not save the registers.<br />

Examples: #int_global<br />

isr() { // Will be located at location 4<br />

for PIC16 chips.<br />

#asm<br />

bsf isr_flag<br />

retfie<br />

#endasm<br />

}<br />

115

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

Saved successfully!

Ooh no, something went wrong!