Labs/Lab6/Watkins_William_Lab6_Part2.c
// <editor-fold defaultstate="collapsed" desc="CCP1Handler()">
/******************************************************************************
 * CCP1handler interrupt service routine.
 *
 * Handles CCP1 for SPI/DAC output and updates the DAC.  Makes this handler 
 * slightly slow in comparison to others, but is required in order to handle 
 * correct timing of DAC.
 ******************************************************************************/

CCP1handler interrupt service routine.

Handles CCP1 for SPI/DAC output and updates the DAC.  Makes this handler
slightly slow in comparison to others, but is required in order to handle
correct timing of DAC.
CCP1handler interrupt service routine . Handles CCP1 for SPI / DAC output and updates the DAC . Makes this handler slightly slow in comparison to others but is required in order to handle correct timing of DAC .
void CCP1Handler() {
    if(PIR1bits.TMR1IF)
        PIR1bits.TMR1IF = 0;    
    CCPR1 += DACInterval;
    updateDAC();
    PIR3bits.CCP1IF = 0;            
}
void CCP1Handler ( ) { if ( PIR1bits . TMR1IF ) PIR1bits . TMR1IF = 0 ; CCPR1 += DACInterval ; updateDAC ( ) ; PIR3bits . CCP1IF = 0 ; }
<editor-fold defaultstate="collapsed" desc="CCP1Handler()">
 CCP1handler interrupt service routine.
<editor - fold defaultstate = " collapsed " desc = " CCP1Handler () " > CCP1handler interrupt service routine .
// Check if Timer 1 has overflowed // No Extension bit, so just reset it // Update CCP1 regs // Clear interrupt flag