Skip to content

Commit 4c71d63

Browse files
committed
fix(color): RTC voltage not updating on hw page
Partially revert change in #5031 re: `enableVBatBridge()` as this needs to be called reguarly so that the RTC voltage is actually read. The call to `disableVBatBridge()` while perhaps technically not needed since `adcRead()` will clear it itself once the voltage actually read certainly won't hurt.
1 parent e4555f9 commit 4c71d63

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

radio/src/gui/colorlcd/radio_hardware.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ RadioHardwarePage::RadioHardwarePage() :
6161
enableVBatBridge();
6262
}
6363

64+
void RadioHardwarePage::checkEvents() { enableVBatBridge(); }
65+
6466
void RadioHardwarePage::cleanup()
6567
{
6668
disableVBatBridge();
@@ -134,11 +136,11 @@ static SetupLineDef setupLines[] = {
134136
GET_SET_INVERTED(g_eeGeneral.disableRtcWarning));
135137

136138
// RTC Batt display
137-
std::string s(STR_VALUE);
138-
s += " ";
139139
new DynamicNumber<uint16_t>(
140-
parent, {x + ToggleSwitch::TOGGLE_W + PAD_SMALL, y + PAD_SMALL + 1, 0, 0}, [] { return getRTCBatteryVoltage(); },
141-
COLOR_THEME_PRIMARY1 | PREC2, s.c_str(), "V");
140+
parent,
141+
{x + ToggleSwitch::TOGGLE_W + PAD_LARGE, y + PAD_SMALL + 1, 0, 0},
142+
[] { return getRTCBatteryVoltage(); }, COLOR_THEME_PRIMARY1 | PREC2,
143+
"", "V");
142144
}
143145
},
144146
{

radio/src/gui/colorlcd/radio_hardware.h

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
class RadioHardwarePage : public PageTab
2727
{
28+
void checkEvents() override;
29+
2830
public:
2931
RadioHardwarePage();
3032

0 commit comments

Comments
 (0)