#include "menu.h"
#include "power.h"
#include "adc_int.h"
-
-#ifndef ADC_BATT_CH
-#define ADC_BATT_CH 7
-#endif
-
-
void update_status(void)
{
cnrlevel = akc6955_get_cnr();
// Battery
// batlevel_6955 = akc6955_get_battery();
- //ADC:Battery
- startadc(ADC_BATT_CH);
+ //ADC:Battery - AN7, 28pins PIC should be changed AN number.
+ startadc(_BATT_ADC);
adc = polladc2();
//ADC:reference
CVRCON2bits.FVREN = 1;
- while(CVRCON2bits.FVRST == 0);
+ while(CVRCON2bits.FVRST == 0) idle_time_ms(1);
startadc(_REF_ADC);
ref = polladc2();
CVRCON2bits.FVREN = 0;