Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: RTC warning not being shown #5209

Merged
merged 2 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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