From 6cd0b4832fec22701224087e8f4c4c72bf6c471b Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 7 Jan 2013 11:11:54 +0000 Subject: [PATCH] [X9D] Tx voltage --- src/open9x.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/open9x.cpp b/src/open9x.cpp index 85614707e..c7f29847d 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -2935,18 +2935,18 @@ void perMain() if (counter-- == 0) { counter = 10; #if defined(PCBX9D) - int32_t instant_vbat = anaIn(7); + int32_t instant_vbat = anaIn(TX_VOLTAGE); instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * 4191 ; instant_vbat /= 55296 ; #elif defined(PCBSKY9X) - int32_t instant_vbat = anaIn(7); + int32_t instant_vbat = anaIn(TX_VOLTAGE); instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * 4191 ; instant_vbat /= 55296 ; #elif defined(PCBGRUVIN9X) - uint16_t instant_vbat = anaIn(7); + 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); #else - uint16_t instant_vbat = anaIn(7); + uint16_t instant_vbat = anaIn(TX_VOLTAGE); instant_vbat = (instant_vbat*16 + instant_vbat*g_eeGeneral.vBatCalib/8) / BandGap; #endif