Why is INTCONbits.PEIE tested in high priority interrupt code generated by MPLAB® Code Configurator on the PIC18F26K22?
The PIC18F26K22 timer will not cause an interrupt unless PEIE and TMR5IE are both enabled. So if a different unrelated interrupt occurs and PEIE is not enabled then the interrupt should not be serviced. This is made to be very generic code, that will cover all conditions.
Note: If you need to increase the interrupt speed or decrease the code size and if you never disable PEIE/TMR5IE you can disregard the check.
Code Reference
void interrupt INTERRUPT_InterruptManagerHigh (void) { // interrupt handler if(INTCONbits.PEIE == 1 && PIE1bits.TMR1IE == 1 && PIR1bits.TMR1IF == 1) { TMR1_ISR(); } }
void interrupt low_priority INTERRUPT_InterruptManagerLow (void) { // interrupt handler if(INTCONbits.PEIE == 1 && PIE5bits.TMR5IE == 1 && PIR5bits.TMR5IF == 1) { TMR5_ISR(); } }