Subversion Repositories Code-Repo

Rev

Rev 280 | Blame | Last modification | View Log | RSS feed

#include "defines.h"
#include "INTERRUPTS.h"
#include "I2C1.h"

void Interrupt_Enable() {
    INTCONbits.GIE = 1;
    INTCONbits.PEIE = 1;
}

void Interrupt_Disable() {
    INTCONbits.GIE = 0;
    INTCONbits.PEIE = 0;
}

void interrupt InterruptHandler(void) {
    
    // Check to see if we have an I2C1 interrupt
    if (PIR1bits.SSP1IF) {
        I2C1_Interrupt_Handler();
        PIR1bits.SSP1IF = 0;
    }

//#ifndef UART_TX_ONLY
//    // Check to see if we have an interrupt on USART1 RX
//    if (PIR1bits.RCIF) {
//        UART_Recv_Interrupt_Handler();
//        PIR1bits.RCIF = 0;
//        if (INTCONbits.TMR0IF)
//            tmr0_rollover = 1;
//    }
//#endif

//    // Check to see if we have an interrupt on USART1 TX
//    if (PIR1bits.TXIF) {
//        UART_Send_Interrupt_Handler();
////        PIR1bits.TXIF = 0;
//        if (INTCONbits.TMR0IF)
//            tmr0_rollover = 1;
//    }

}