Skip to content

Commit

Permalink
Better fix for issues when adding new inputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz committed Nov 17, 2023
1 parent bd864df commit 848b863
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions radio/src/gui/colorlcd/model_inputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,15 @@ void ModelInputsPage::newInput()
// search for unused channels
for (uint8_t i = 0; i < MAX_EXPOS && chn < MAX_INPUTS; i++) {
if (!EXPO_VALID(line) || (line->chn > chn)) {
std::string name(getSourceString(chn + 1));
menu->addLineBuffered(name.c_str(), [=]() { insertInput(chn, index); });
uint8_t chnEnd = EXPO_VALID(line) ? line->chn : chn + 1;
for (; chn < chnEnd; chn += 1) {
std::string name(getSourceString(chn + 1));
menu->addLineBuffered(name.c_str(), [=]() { insertInput(chn, index); });
}
}
if (EXPO_VALID(line)) {
chn = line->chn + 1;
index += 1;
} else {
chn += 1;
}
++line;
}
Expand Down

0 comments on commit 848b863

Please sign in to comment.