Skip to content

Commit

Permalink
Revert "fix(color): New inputs disappear until restart"
Browse files Browse the repository at this point in the history
This reverts commit e9a022e.
  • Loading branch information
pfeerick authored and MRC3742 committed Dec 22, 2023
1 parent 58ec26f commit 4d78e07
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions radio/src/gui/colorlcd/model_inputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,21 +336,19 @@ void ModelInputsPage::newInput()
menu->setTitle(STR_MENU_INPUTS);

uint8_t chn = 0;
uint8_t index = 0;
ExpoData* line = g_model.expoData;

// search for unused channels
for (uint8_t i = 0; i < MAX_EXPOS && chn < MAX_INPUTS; i++) {
for (uint8_t i = 0; i < MAX_EXPOS; i++) {
if (!EXPO_VALID(line) || (line->chn > chn)) {
if (chn >= MAX_INPUTS) break;
std::string name(getSourceString(chn+1));
menu->addLineBuffered(name.c_str(), [=]() { insertInput(chn, index); });
menu->addLineBuffered(name.c_str(), [=]() { insertInput(chn, i); });
}
if (EXPO_VALID(line)) {
if (EXPO_VALID(line))
chn = line->chn + 1;
index += 1;
} else {
else
chn += 1;
}
++line;
}

Expand Down

0 comments on commit 4d78e07

Please sign in to comment.