Subversion Repositories Code-Repo

Rev

Rev 121 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 121 Rev 123
Line 1... Line 1...
1
#include "maindefs.h"
1
#include "maindefs.h"
2
#include "uart.h"
2
#include "uart.h"
3
#include "i2c.h"
3
#include "i2c.h"
4
#include "spi.h"
4
#include "spi.h"
-
 
5
#include "adc.h"
5
#include "interrupts.h"
6
#include "interrupts.h"
6
 
7
 
7
//----------------------------------------------------------------------------
8
//----------------------------------------------------------------------------
8
// Note: This code for processing interrupts is configured to allow for high and
9
// Note: This code for processing interrupts is configured to allow for high and
9
//       low priority interrupts.  The high priority interrupt can interrupt the
10
//       low priority interrupts.  The high priority interrupt can interrupt the
Line 26... Line 27...
26
    // Low priority interrupts
27
    // Low priority interrupts
27
    
28
    
28
//    INTCON2bits.TMR0IP = 0; // Timer0 interrupt
29
//    INTCON2bits.TMR0IP = 0; // Timer0 interrupt
29
//    IPR1bits.TMR1IP = 0;    // Timer1 interrupt
30
//    IPR1bits.TMR1IP = 0;    // Timer1 interrupt
30
//    IPR2bits.TMR3IP = 0; // Timer 3 interrupt
31
//    IPR2bits.TMR3IP = 0; // Timer 3 interrupt
31
//    IPR1bits.ADIP = 0;      // ADC interupt
32
    IPR1bits.ADIP = 0;      // ADC interupt
32
//    INTCON2bits.RBIP = 0;   // Port B interrupt
33
//    INTCON2bits.RBIP = 0;   // Port B interrupt
33
//    INTCON3bits.INT1IP = 0; // INT1 interrupt
34
//    INTCON3bits.INT1IP = 0; // INT1 interrupt
34
    
35
    
35
    // Enable Port B interrupt
36
    // Enable Port B interrupt
36
//    INTCONbits.RBIE = 1;
37
//    INTCONbits.RBIE = 1;
Line 209... Line 210...
209
//        timer3_interrupt_handler();
210
//        timer3_interrupt_handler();
210
//
211
//
211
//        PIR2bits.TMR3IF = 0;
212
//        PIR2bits.TMR3IF = 0;
212
//    }
213
//    }
213
 
214
 
214
//    // Check to see if we have an interrupt on ADC
215
    // Check to see if we have an interrupt on ADC
215
//    if (PIR1bits.ADIF) {
216
    if (PIR1bits.ADIF) {
216
//        // Call the interrupt handler
217
        // Call the interrupt handler
217
//        adc_interrupt_handler();
218
        ADC_Interrupt_Handler();
218
//
219
 
219
//        // Clear the interrupt flag
220
        // Clear the interrupt flag
220
//        PIR1bits.ADIF = 0;
221
        PIR1bits.ADIF = 0;
221
//    }
222
    }
222
}
223
}
223
 
224