Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 147 → Rev 150

/PIC Stuff/PIC_27J13/interrupts.c
26,7 → 26,6
IPR3bits.SSP2IP = 1; // MSSP2 (SPI2) interrupt
 
// Low priority interrupts
// INTCON2bits.TMR0IP = 0; // Timer0 interrupt
IPR1bits.TMR1IP = 0; // Timer1 interrupt
// IPR2bits.TMR3IP = 0; // Timer 3 interrupt
48,32 → 47,32
INTCONbits.GIEL = 1;
}
 
int interrupt_in_high_interrupt_routine() {
return (!INTCONbits.GIEH);
}
//int interrupt_in_high_interrupt_routine() {
// return (!INTCONbits.GIEH);
//}
//
//int interrupt_low_int_active() {
// return (!INTCONbits.GIEL);
//}
//
//int interrupt_in_low_interrupt_routine() {
// if (INTCONbits.GIEL == 1) {
// return (0);
// } else if (interrupt_in_high_interrupt_routine()) {
// return (0);
// } else {
// return (1);
// }
//}
//
//int interrupt_in_main_routine() {
// if ((!interrupt_in_low_interrupt_routine()) && (!interrupt_in_high_interrupt_routine())) {
// return (1);
// } else {
// return (0);
// }
//}
 
int interrupt_low_int_active() {
return (!INTCONbits.GIEL);
}
 
int interrupt_in_low_interrupt_routine() {
if (INTCONbits.GIEL == 1) {
return (0);
} else if (interrupt_in_high_interrupt_routine()) {
return (0);
} else {
return (1);
}
}
 
int interrupt_in_main_routine() {
if ((!interrupt_in_low_interrupt_routine()) && (!interrupt_in_high_interrupt_routine())) {
return (1);
} else {
return (0);
}
}
 
// Set up the interrupt vectors
void InterruptHandlerHigh();
void InterruptHandlerLow();