Subversion Repositories Code-Repo

Rev

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

Rev 315 Rev 316
Line 1... Line 1...
1
#include "defines.h"
1
#include "defines.h"
2
#include "INTERRUPTS.h"
2
#include "INTERRUPTS.h"
3
#include "IOC.h"
3
#include "IOC.h"
4
#include "SPI.h"
4
#include "SPI.h"
-
 
5
#include "TIMER.h"
5
 
6
 
6
void Interrupt_Init() {
7
void Interrupt_Init() {
7
}
8
}
8
 
9
 
9
void Interrupt_Enable() {
10
void Interrupt_Enable() {
Line 19... Line 20...
19
 
20
 
20
void interrupt InterruptHandler(void) {
21
void interrupt InterruptHandler(void) {
21
    // We need to check the interrupt flag of each enabled high-priority interrupt to
22
    // We need to check the interrupt flag of each enabled high-priority interrupt to
22
    //  see which device generated this interrupt.  Then we can call the correct handler.
23
    //  see which device generated this interrupt.  Then we can call the correct handler.
23
 
24
 
-
 
25
    if (PIR1bits.TMR2IF) {
-
 
26
 
-
 
27
        TIMER_2_Interrupt_Handler();
-
 
28
        
-
 
29
        PIR1bits.TMR2IF = 0;
-
 
30
        return;
-
 
31
    }
-
 
32
    
24
    if (INTCONbits.IOCIF) {
33
    if (INTCONbits.IOCIF) {
25
        // Call the handler
34
        // Call the handler
26
        IOC_Interrupt_Handler();
35
        IOC_Interrupt_Handler();
27
 
36
 
28
        INTCONbits.IOCIF = 0;
37
        INTCONbits.IOCIF = 0;
29
 
38
 
30
        return;
39
        return;
31
    }
40
    }
32
 
41
 
33
//    // Check to see if we have an I2C interrupt
-
 
34
//    if (PIR1bits.SSP1IF) {
-
 
35
//
-
 
36
//        // Call the handler
-
 
37
//        I2C1_Interrupt_Handler();
-
 
38
//
-
 
39
//        // Clear the interrupt flag
-
 
40
//        PIR1bits.SSP1IF = 0;
-
 
41
//
-
 
42
//        return;
-
 
43
//    }
-
 
44
 
-
 
45
//    if (PIR1bits.RCIF) {
-
 
46
//
-
 
47
//        // Call the handler
-
 
48
//        UART_RX_Interrupt_Handler();
-
 
49
//
-
 
50
//        // Clear the interrupt flag
-
 
51
//        PIR1bits.RCIF = 0;
-
 
52
//
-
 
53
//        return;
-
 
54
//    }
-
 
55
 
-
 
56
//    if (PIR1bits.TXIF) {
-
 
57
//
-
 
58
//        // Call the handler
-
 
59
//        UART_TX_Interrupt_Handler();
-
 
60
//
-
 
61
//        // Clear the interrupt flag
-
 
62
//        PIR1bits.TXIF = 0;
-
 
63
//
-
 
64
//        return;
-
 
65
//    }
-
 
66
 
42
 
67
}
43
}