Labs/Lab6/Watkins_William_Lab6_Part2.c
// <editor-fold defaultstate="collapsed" desc="EUSARTCommandHandler()">
/******************************************************************************
 * EUSARTCommandHandler interrupt service routine.
 *
 * Handles incoming EUSART Commands
 ******************************************************************************/

EUSARTCommandHandler interrupt service routine.

Handles incoming EUSART Commands
EUSARTCommandHandler interrupt service routine . Handles incoming EUSART Commands
void EUSARTCommandHandler() {
    if(RCSTA1bits.FERR)     
    {
        temporary = RCREG1;
        return;
    }
    if(RCSTA1bits.OERR)     
    {
        RCSTA1bits.CREN = 0;
        RCSTA1bits.CREN = 1;
        return;
    }
    buffer[i] = RCREG1; 
    if(buffer[i] != 0x0A)
    {
        i++;
    }
    else
    {
        rxFin = 1;  
    }
}
void EUSARTCommandHandler ( ) { if ( RCSTA1bits . FERR ) { temporary = RCREG1 ; return ; } if ( RCSTA1bits . OERR ) { RCSTA1bits . CREN = 0 ; RCSTA1bits . CREN = 1 ; return ; } buffer [ i ] = RCREG1 ; if ( buffer [ i ] != 0x0A ) { i ++ ; } else { rxFin = 1 ; } }
<editor-fold defaultstate="collapsed" desc="EUSARTCommandHandler()">
 EUSARTCommandHandler interrupt service routine.
<editor - fold defaultstate = " collapsed " desc = " EUSARTCommandHandler () " > EUSARTCommandHandler interrupt service routine .
// Handles framing error // Handles Overrun error // If no errors, load byte into buffer register // If the line feed character is received, we're done receiving