Subversion Repositories Code-Repo

Rev

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

Rev 157 Rev 158
Line 1... Line 1...
1
#include <xc.h>
1
#include <xc.h>
2
#include "defines.h"
2
#include "defines.h"
3
#include "interrupts.h"
3
#include "base_INTERRUPTS.h"
4
#include "uart.h"
4
#include "base_UART.h"
5
#include "i2c.h"
5
#include "base_I2C.h"
6
#include "timers.h"
6
#include "base_TIMERS.h"
7
 
7
 
8
void Interrupt_Init() {
8
void Interrupt_Init() {
9
    // Peripheral interrupts can have their priority set to high or low
9
    // Peripheral base_INTERRUPTS.can have their priority set to high or low
10
    // Decide on the priority of the enabled peripheral interrupts (0 is low, 1 is high)
10
    // Decide on the priority of the enabled peripheral interrupts (0 is low, 1 is high)
11
 
11
 
12
    // High priority interrupts
12
    // High priority interrupts
13
    IPR1bits.RC1IP = 1;     // USART1 RX interrupt
13
    IPR1bits.RC1IP = 1;     // USART1 RX interrupt
14
    IPR1bits.TX1IP = 1;     // USART1 TX interrupt
14
    IPR1bits.TX1IP = 1;     // USART1 TX interrupt
Line 29... Line 29...
29
    // Enable interrupt for INT1
29
    // Enable interrupt for INT1
30
//    INTCON3bits.INT1IE = 1;
30
//    INTCON3bits.INT1IE = 1;
31
}
31
}
32
 
32
 
33
void Interrupt_Enable() {
33
void Interrupt_Enable() {
34
    // Peripheral interrupts can have their priority set to high or low.
34
    // Peripheral base_INTERRUPTS.can have their priority set to high or low.
35
    // Enable both high-priority interrupts and low-priority interrupts
35
    // Enable both high-priority interrupts and low-priority interrupts
36
    RCONbits.IPEN = 1;
36
    RCONbits.IPEN = 1;
37
    INTCONbits.GIEH = 1;
37
    INTCONbits.GIEH = 1;
38
    INTCONbits.GIEL = 1;
38
    INTCONbits.GIEL = 1;
39
}
39
}