Skip to content

Commit

Permalink
fix: RTC warning not being shown (#5209)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeerick committed Jun 23, 2024
1 parent 0d6d35e commit 22114a6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
10 changes: 6 additions & 4 deletions radio/src/gui/colorlcd/radio_hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ RadioHardwarePage::RadioHardwarePage() :
enableVBatBridge();
}

void RadioHardwarePage::checkEvents() { enableVBatBridge(); }

void RadioHardwarePage::cleanup()
{
disableVBatBridge();
Expand Down Expand Up @@ -134,11 +136,11 @@ static SetupLineDef setupLines[] = {
GET_SET_INVERTED(g_eeGeneral.disableRtcWarning));

// RTC Batt display
std::string s(STR_VALUE);
s += " ";
new DynamicNumber<uint16_t>(
parent, {x + ToggleSwitch::TOGGLE_W + PAD_SMALL, y + PAD_SMALL + 1, 0, 0}, [] { return getRTCBatteryVoltage(); },
COLOR_THEME_PRIMARY1 | PREC2, s.c_str(), "V");
parent,
{x + ToggleSwitch::TOGGLE_W + PAD_LARGE, y + PAD_SMALL + 1, 0, 0},
[] { return getRTCBatteryVoltage(); }, COLOR_THEME_PRIMARY1 | PREC2,
"", "V");
}
},
{
Expand Down
2 changes: 2 additions & 0 deletions radio/src/gui/colorlcd/radio_hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

class RadioHardwarePage : public PageTab
{
void checkEvents() override;

public:
RadioHardwarePage();

Expand Down
8 changes: 4 additions & 4 deletions radio/src/opentx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ static void checkFailsafe()
#endif

#if defined(GUI)
void checkAll()
void checkAll(bool isBootCheck)
{
#if defined(EEPROM_RLC) && !defined(SDCARD_RAW) && !defined(SDCARD_YAML)
checkLowEEPROM();
Expand All @@ -640,9 +640,9 @@ void checkAll()
checkSwitches();
checkFailsafe();


if (isVBatBridgeEnabled() && !g_eeGeneral.disableRtcWarning) {
if (isBootCheck && !g_eeGeneral.disableRtcWarning) {
// only done once at board start
enableVBatBridge();
checkRTCBattery();
}
disableVBatBridge();
Expand Down Expand Up @@ -1533,7 +1533,7 @@ void edgeTxInit()
}
else if (!(startOptions & OPENTX_START_NO_CHECKS)) {
checkAlarm();
checkAll();
checkAll(true);
PLAY_MODEL_NAME();
}
#endif // defined(GUI)
Expand Down
2 changes: 1 addition & 1 deletion radio/src/opentx.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void checkLowEEPROM();
void checkThrottleStick();
void checkSwitches();
void checkAlarm();
void checkAll();
void checkAll(bool isBootCheck = false);

void getADC();

Expand Down

0 comments on commit 22114a6

Please sign in to comment.