#include <math.h>
#include "xc.h"
#include "CalibrationConstants.h"
#include "extern.h" 

#ifdef DEBUG
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "UART.h"
#endif

//Calibration Constants to relate cnts to engineering units.
//Any definitions here should also have an extern declartion in extern.h

const int ZoomFollow_cnt[2] =  {-32768, 32767};  //Cooresponds to 0->5V
const float ZoomFollow_eng[2] =  {0 , 5.0};  // Volts

const int FocusFollow_cnt[2] =  {-32768, 32767};  //Cooresponds to 0->5V
const float FocusFollow_eng[2] = {0 , 5.0};  // Volts

const int ADC_CameraTemp_cnt[2] =  {0, 9929};  //Cooresponds to 0->1V
const float ADC_CameraTemp_eng[2] =  {-50 , 50.0};  //DegC


/*  Compute various scaling between counts and engineering units, based Iwind_cnt/eng and RPMs_cnt/eng */
    /* Important things rely on this being set up, so this function must be called early */
void ComputeScaling(void)
{   
    return;
}


#ifdef DEBUG  //Display the resulting scaling on screen at powerup in debug mode
void PrintScaling(void)
{
    char s[256];
    sprintf(s, "ADC_CameraTemp cnt/eng    %d     %d     %f     %f\r\n",
            ADC_CameraTemp_cnt[0],ADC_CameraTemp_cnt[1],
            ADC_CameraTemp_eng[0],ADC_CameraTemp_eng[1]);
    putsU1(s);

}   
#endif
    



