Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 127 → Rev 147

/PIC Stuff/PIC_27J13/interrupts.c
1,9 → 1,10
#include "maindefs.h"
#include "defines.h"
#include "interrupts.h"
#include "uart.h"
#include "i2c.h"
#include "spi.h"
#include "adc.h"
#include "timers.h"
 
//----------------------------------------------------------------------------
// Note: This code for processing interrupts is configured to allow for high and
27,9 → 28,9
// Low priority interrupts
// INTCON2bits.TMR0IP = 0; // Timer0 interrupt
// IPR1bits.TMR1IP = 0; // Timer1 interrupt
IPR1bits.TMR1IP = 0; // Timer1 interrupt
// IPR2bits.TMR3IP = 0; // Timer 3 interrupt
IPR1bits.ADIP = 0; // ADC interupt
// IPR1bits.ADIP = 0; // ADC interupt
// INTCON2bits.RBIP = 0; // Port B interrupt
// INTCON3bits.INT1IP = 0; // INT1 interrupt
104,17 → 105,17
// We need to check the interrupt flag of each enabled high-priority interrupt to
// see which device generated this interrupt. Then we can call the correct handler.
 
// Check to see if we have an SPI2 interrupt
if (PIR3bits.SSP2IF) {
// Call the handler
SPI2_Recv_Interrupt_Handler();
// // Check to see if we have an SPI2 interrupt
// if (PIR3bits.SSP2IF) {
// // Call the handler
// SPI2_Recv_Interrupt_Handler();
//
// // Clear the interrupt flag
// PIR3bits.SSP2IF = 0;
//
// return;
// }
 
// Clear the interrupt flag
PIR3bits.SSP2IF = 0;
 
return;
}
 
// Check to see if we have an I2C interrupt
if (PIR1bits.SSPIF) {
// Call the handler
195,15 → 196,15
// INTCONbits.TMR0IF = 0;
// }
 
// // Check to see if we have an interrupt on timer 1
// if (PIR1bits.TMR1IF) {
// // Call the interrupt handler
// timer1_interrupt_handler();
//
// // Clear the interrupt flag
// PIR1bits.TMR1IF = 0;
// }
// Check to see if we have an interrupt on timer 1
if (PIR1bits.TMR1IF) {
// Call the interrupt handler
Timer1_Interrupt_Handler();
 
// Clear the interrupt flag
PIR1bits.TMR1IF = 0;
}
 
// // Check to see if we have an interrupt on timer 3
// if (PIR2bits.TMR3IF) {
// DBG_PRINT_INT("INT: Timer 3\r\n");
212,13 → 213,13
// PIR2bits.TMR3IF = 0;
// }
 
// Check to see if we have an interrupt on ADC
if (PIR1bits.ADIF) {
// Call the interrupt handler
ADC_Interrupt_Handler();
 
// Clear the interrupt flag
PIR1bits.ADIF = 0;
}
// // Check to see if we have an interrupt on ADC
// if (PIR1bits.ADIF) {
// // Call the interrupt handler
// ADC_Interrupt_Handler();
//
// // Clear the interrupt flag
// PIR1bits.ADIF = 0;
// }
}