Subversion Repositories Code-Repo

Rev

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

Rev 111 Rev 112
Line 12... Line 12...
12
    TRISCbits.TRISC2 = 0;
12
    TRISCbits.TRISC2 = 0;
13
    LATCbits.LATC2 = 0;
13
    LATCbits.LATC2 = 0;
14
 
14
 
15
    RPINR1 = 2; // Bind INT1 interrupt to RP2
15
    RPINR1 = 2; // Bind INT1 interrupt to RP2
16
 
16
 
17
    INTCON3bits.INT1IE = 1;     // Enable interrupt for INT1
-
 
18
    INTCON2bits.INTEDG1 = 0;    // Trigger on falling edge
17
    INTCON2bits.INTEDG1 = 0;    // Trigger on falling edge
19
}
18
}
20
 
19
 
21
void int1_interrupt_handler() {
20
void int1_interrupt_handler() {
22
    LATCbits.LATC2 = 1;
21
    LATCbits.LATC2 = 1;
23
    Delay10TCYx(1);
22
    Delay10TCYx(255);
24
    LATCbits.LATC2 = 0;
23
    LATCbits.LATC2 = 0;
-
 
24
    MQ_sendmsg_ToMainFromLow(0, MSGTYPE_INT1, (void *) 0);
25
}
25
}
26
 
26
 
27
void port_b_int_init() {
27
void port_b_int_init() {
28
    port_b_prev_state = 0x0F;
28
    port_b_prev_state = 0x0F;
29
 
29