From 28bd8e4f07f928330cb33846d503309104c951ed Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 11 Mar 2013 20:07:54 +0000 Subject: [PATCH] [X9D] Voltage measurement fixed, thanks Mike! --- src/open9x.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/open9x.cpp b/src/open9x.cpp index 6de5373bb..518f2b358 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -3441,8 +3441,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 ) * 15 ; - instant_vbat /= 256 ; + instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * 150 ; + instant_vbat >>= 11; #elif defined(PCBSKY9X) int32_t instant_vbat = anaIn(TX_VOLTAGE); instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * 4191 ;