From 4c24e881c40ee880752bcfc174864eeab5022638 Mon Sep 17 00:00:00 2001 From: "bernet.andre@gmail.com" Date: Tue, 8 Jan 2013 09:45:11 +0000 Subject: [PATCH] [X9D] Analog ref is 3V, not 3.3V --- src/general_menus.cpp | 4 ++-- src/open9x.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/general_menus.cpp b/src/general_menus.cpp index cc894a950..91b952b24 100644 --- a/src/general_menus.cpp +++ b/src/general_menus.cpp @@ -892,8 +892,8 @@ void menuGeneralDiagAna(uint8_t event) lcd_putsLeft(5*FH, STR_BATT_CALIB); static uint32_t adcBatt; adcBatt = ((adcBatt * 7) + anaIn(8)) / 8; // running average, sourced directly (to avoid unending debate :P) - uint32_t batCalV = ( adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128 ) * 33 ; - batCalV /= 512 ; + uint32_t batCalV = ( adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128 ) * 15 ; + batCalV /= 256 ; putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 5*FH, batCalV, (m_posVert==1 ? INVERS : 0)); #else lcd_putsLeft(6*FH-2, STR_BATT_CALIB); diff --git a/src/open9x.cpp b/src/open9x.cpp index 0898b865b..ea2ba4180 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -2944,8 +2944,8 @@ void perMain() counter = 10; #if defined(PCBX9D) int32_t instant_vbat = anaIn(TX_VOLTAGE); - instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * 33 ; - instant_vbat /= 512 ; + instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * 15 ; + instant_vbat /= 256 ; #elif defined(PCBSKY9X) int32_t instant_vbat = anaIn(TX_VOLTAGE); instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * 4191 ;