RTC bridge fix (#360)

* RTC bridge fix

Merged code by @bsongis from https://github.com/opentx/opentx/pull/8577
This commit is contained in:
Risto
2021-06-28 08:46:27 +02:00
committed by GitHub
parent 84a6cece48
commit 8efe5e767e
+7 -6
View File
@@ -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)