diff --git a/src/gui/menu_general.cpp b/src/gui/menu_general.cpp index 6302c0fcc..7072b11aa 100644 --- a/src/gui/menu_general.cpp +++ b/src/gui/menu_general.cpp @@ -993,6 +993,7 @@ void menuGeneralDiagAna(uint8_t event) adcBatt = ((adcBatt * 7) + anaIn(8)) / 8; // running average, sourced directly (to avoid unending debate :P) uint32_t batCalV = ( adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128 ) * BATT_SCALE; batCalV >>= 11; + batCalV += 2; // because of the diode putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 6*FH+1, batCalV, (m_posVert==1 ? INVERS : 0)); #else lcd_putsLeft(6*FH-2, STR_BATT_CALIB); diff --git a/src/opentx.cpp b/src/opentx.cpp index 135ebbb38..63d10c6a4 100644 --- a/src/opentx.cpp +++ b/src/opentx.cpp @@ -3673,11 +3673,11 @@ void perMain() int32_t instant_vbat = anaIn(TX_VOLTAGE); instant_vbat = ( instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128 ) * BATT_SCALE; instant_vbat >>= 11; + instant_vbat += 2; // because of the diode #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 += 2; // because of the diode #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);