[X9D] REV3 voltage regression (I already forgot the REV3!!!). Thanks Mike!
This commit is contained in:
+3
-3
@@ -3441,12 +3441,12 @@ void perMain()
|
||||
counter = 10;
|
||||
#if defined(PCBX9D)
|
||||
int32_t instant_vbat = anaIn(TX_VOLTAGE);
|
||||
instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * 150 ;
|
||||
instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * BATT_SCALE;
|
||||
instant_vbat >>= 11;
|
||||
#elif defined(PCBSKY9X)
|
||||
int32_t instant_vbat = anaIn(TX_VOLTAGE);
|
||||
instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * 4191 ;
|
||||
instant_vbat /= 55296 ;
|
||||
instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * 4191;
|
||||
instant_vbat /= 55296;
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
uint16_t instant_vbat = anaIn(TX_VOLTAGE);
|
||||
instant_vbat = ((uint32_t)instant_vbat*1112 + (int32_t)instant_vbat*g_eeGeneral.vBatCalib + (BandGap<<2)) / (BandGap<<3);
|
||||
|
||||
@@ -134,6 +134,11 @@ void watchdogInit();
|
||||
void adcInit();
|
||||
void adcRead();
|
||||
extern volatile uint16_t Analog_values[];
|
||||
#if defined(REV3)
|
||||
#define BATT_SCALE 120
|
||||
#else
|
||||
#define BATT_SCALE 150
|
||||
#endif
|
||||
|
||||
// Power driver
|
||||
void pwrInit();
|
||||
|
||||
Reference in New Issue
Block a user