1 /******************************************************************************/
3 /******************************************************************************/
6 #include <xc.h> /* XC8 General Include File */
7 #elif defined(HI_TECH_C)
8 #include <htc.h> /* HiTech General Include File */
11 #include <stdint.h> /* For uint8_t definition */
12 #include <stdbool.h> /* For true/false definition */
15 /******************************************************************************/
16 /* Interrupt Routines */
17 /******************************************************************************/
19 /* Baseline devices don't have interrupts. Unfortunately the baseline detection
20 * macro is named _PIC12 */
24 void interrupt isr(void)
26 /* This code stub shows general interrupt handling. Note that these
27 conditional statements are not handled within 3 seperate if blocks.
28 Do not use a seperate if block for each interrupt flag to avoid run
31 if (PIE1bits.TXIE && PIR1bits.TXIF)
34 if (PIE1bits.RCIE && PIR1bits.RCIF)
37 if (T1CONbits.TMR1ON && PIR1bits.TMR1IF) {
43 /* TODO Add interrupt routine code here. */
45 /* Determine which flag generated the interrupt */
46 if(<Interrupt Flag 1>)
48 <Interrupt Flag 1=0>; /* Clear Interrupt Flag 1 */
50 else if (<Interrupt Flag 2>)
52 <Interrupt Flag 2=0>; /* Clear Interrupt Flag 2 */
56 /* Unhandled interrupts */