#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 = getU2();
          c = U1RXREG;
        switch (c) {
#ifdef ALLOW_CALIBRATION
                case 'r': //Set display to raw counts
                    raw = 1;
                break;

               case 'e': //Set display to engineering units
                    raw = 0;
                break;
#endif
               case 'z': //Set total to zero
                    time_relative = 0.0;
                    paddlewheel_cnts = 0;
                break;

             default:
                break;
        }


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

}

