OSDN Git Service

[Disp][v2.0][ADC] Insert idle_time_ms(1) to polling FVR will be stable.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 2 Oct 2013 05:29:21 +0000 (14:29 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 2 Oct 2013 05:29:21 +0000 (14:29 +0900)
radio_getstat.c

index f5f4a84..43ef5ae 100644 (file)
 #include "menu.h"
 #include "power.h"
 #include "adc_int.h"
-
-#ifndef ADC_BATT_CH
-#define ADC_BATT_CH 7
-#endif
-
-
 void update_status(void)
 {
 
@@ -85,12 +79,12 @@ 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;