Subversion Repositories Code-Repo

Rev

Rev 107 | Rev 111 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 107 Rev 109
Line 95... Line 95...
95
    
95
    
96
    // Check to see if we have an I2C interrupt
96
    // Check to see if we have an I2C interrupt
97
    if (PIR1bits.SSPIF) {
97
    if (PIR1bits.SSPIF) {
98
        // Nofity the xbee to stop sending serial data
98
        // Nofity the xbee to stop sending serial data
99
        xbee_set_RTS(1);
99
        xbee_set_RTS(1);
100
 
-
 
101
        // Clear the interrupt flag
-
 
102
        PIR1bits.SSPIF = 0;
-
 
103
        
100
        
104
        // Call the handler
101
        // Call the handler
105
        i2c_interrupt_handler();
102
        i2c_interrupt_handler();
106
 
103
 
-
 
104
        // Clear the interrupt flag
-
 
105
        PIR1bits.SSPIF = 0;
-
 
106
 
107
        // Notify xbee to resume sending serial data
107
        // Notify xbee to resume sending serial data
108
        xbee_set_RTS(0);
108
        xbee_set_RTS(0);
109
    }
109
    }
110
 
110
 
111
    // Check to see if we have an interrupt on USART2 RX
111
    // Check to see if we have an interrupt on USART2 RX
Line 118... Line 118...
118
    }
118
    }
119
 
119
 
120
#ifdef _MASTER
120
#ifdef _MASTER
121
    // Check to see if we have an interrupt on INT1
121
    // Check to see if we have an interrupt on INT1
122
    if (INTCON3bits.INT1IF) {
122
    if (INTCON3bits.INT1IF) {
123
        INTCON3bits.INT1IF = 0;
-
 
124
 
-
 
125
        int1_interrupt_handler();
123
        int1_interrupt_handler();
-
 
124
 
-
 
125
        INTCON3bits.INT1IF = 0;
126
    }
126
    }
127
#endif
127
#endif
128
 
128
 
-
 
129
    // Check to see if we have an interrupt on any port B inputs <4:7>
-
 
130
    if (INTCONbits.RBIF) {
-
 
131
        port_b_int_interrupt_handler();
-
 
132
 
-
 
133
        INTCONbits.RBIF = 0;
-
 
134
    }
-
 
135
    
129
//    // Check to see if we have an interrupt on timer 1
136
//    // Check to see if we have an interrupt on timer 1
130
//    if (PIR1bits.TMR1IF) {
137
//    if (PIR1bits.TMR1IF) {
131
//        // Clear the interrupt flag
138
//        // Clear the interrupt flag
132
//        PIR1bits.TMR1IF = 0;
139
//        PIR1bits.TMR1IF = 0;
133
//
140
//
134
//        // Call the interrupt handler
141
//        // Call the interrupt handler
135
//        timer1_interrupt_handler();
142
//        timer1_interrupt_handler();
136
//    }
143
//    }
137
 
144
 
138
//    // Check to see if we have an interrupt on any port B inputs <4:7>
-
 
139
//    if (INTCONbits.RBIF) {
-
 
140
//        port_b_int_interrupt_handler();
-
 
141
//
-
 
142
//        INTCONbits.RBIF = 0;
-
 
143
//    }
-
 
144
 
-
 
145
    // The *last* thing I do here is check to see if we can
145
    // The *last* thing I do here is check to see if we can
146
    // allow the processor to go to sleep
146
    // allow the processor to go to sleep
147
    // This code *DEPENDS* on the code in messages.c being
147
    // This code *DEPENDS* on the code in messages.c being
148
    // initialized using "init_queues()" -- if you aren't using
148
    // initialized using "init_queues()" -- if you aren't using
149
    // this, then you shouldn't have this call here
149
    // this, then you shouldn't have this call here