From 8efe5e767ef237004a3494f5411ce9bee1d7a0ed Mon Sep 17 00:00:00 2001 From: Risto Date: Mon, 28 Jun 2021 08:46:27 +0200 Subject: [PATCH] RTC bridge fix (#360) * RTC bridge fix Merged code by @bsongis from https://github.com/opentx/opentx/pull/8577 --- radio/src/opentx.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index e934bcdcb..46c31d190 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -694,11 +694,9 @@ void checkMultiLowPower() #if defined(STM32) static void checkRTCBattery() { - if (isVBatBridgeEnabled()) { - if (getRTCBatteryVoltage() < 200) { - ALERT(STR_BATTERY, STR_WARN_RTC_BATTERY_LOW, AU_ERROR); - } - disableVBatBridge(); + GET_ADC_IF_MIXER_NOT_RUNNING(); + if (getRTCBatteryVoltage() < 200) { + ALERT(STR_BATTERY, STR_WARN_RTC_BATTERY_LOW, AU_ERROR); } } #endif @@ -752,8 +750,11 @@ void checkAll() #endif #if defined(STM32) - if (!g_eeGeneral.disableRtcWarning) + if (isVBatBridgeEnabled() && !g_eeGeneral.disableRtcWarning) { + // only done once at board start checkRTCBattery(); + } + disableVBatBridge(); #endif #if defined(COLORLCD)