Skip to content

Commit

Permalink
Refresh module UI if module data was updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Mitchell authored and richardclli committed Apr 22, 2023
1 parent 6314644 commit 3baf692
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions radio/src/gui/colorlcd/module_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ class ModuleWindow : public FormGroup
FailsafeChoice* fsChoice = nullptr;
Choice *rfPower = nullptr;
StaticText *idUnique = nullptr;
tmr10ms_t lastRefreshTime = 0;

void checkEvents() override {
if (lastModuleUpdatedTime[moduleIdx] > lastRefreshTime) {
updateModule();
}
}

void startRSSIDialog(std::function<void()> closeHandler = nullptr);

Expand Down Expand Up @@ -189,6 +196,8 @@ void ModuleWindow::updateIDStaticText(int mdIdx)

void ModuleWindow::updateModule()
{
lastRefreshTime = get_tmr10ms();

FlexGridLayout grid(col_dsc, row_dsc, 2);
clear();

Expand Down

0 comments on commit 3baf692

Please sign in to comment.