#include <stdio.h>
#include "xc.h"
#include "math.h"
#include "UART.h"
#include "config.h"
#include "extern.h"


void __attribute__((__interrupt__,auto_psv)) _U1RXInterrupt(void)
//void __attribute__((__interrupt__(__save__(CORCON)))) _U2RXInterrupt(void)
{
    char c;
    __asm__ volatile ("push CORCON");
          c = getU1();
         // c = U1RXREG;
        switch (c) {

                case 'r': //Set display to raw counts
                    raw = 1;
                break;

               case 'e': //Set display to engineering units
                    raw = 0;
                break;        

             default:
                break;
        }


    _U1RXIF = 0; //Clear Interrupt
    __asm__ volatile ("pop CORCON");

}

