Subversion Repositories Code-Repo

Rev

Rev 284 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
284 Kevin 1
#include "defines.h"
2
#include "INTERRUPTS.h"
3
#include "I2C1.h"
4
 
5
void Interrupt_Init() {
6
 
7
}
8
 
9
void Interrupt_Enable() {
10
    // Enable global and peripheral interrupts
11
    INTCONbits.PEIE = 1;
12
    INTCONbits.GIE = 1;
13
}
14
 
15
void Interrupt_Disable() {
16
    INTCONbits.PEIE = 0;
17
    INTCONbits.GIE = 0;
18
}
19
 
20
void interrupt InterruptHandler(void) {
21
 
22
    // Check to see if we have an I2C1 interrupt
23
    if (PIR1bits.SSP1IF) {
24
        // Call the handler
25
        I2C1_Interrupt_Handler();
26
 
27
        // Clear the interrupt flag
28
        PIR1bits.SSP1IF = 0;
29
    }
30
 
31
//    // Check to see if we have an IO interrupt
32
//    if (INTCONbits.IOCIF) {
33
//        // Call the handler
34
//        IO_Interrupt();
35
//
36
//        return;
37
//    }
38
 
39
}