[color] Set proper CRSF module state when model-ID has changed

Resolves #559
This commit is contained in:
Raphael Coeffic
2021-08-05 10:39:41 +02:00
committed by Raphael Coeffic
parent 5cd68753d3
commit 356449ce73
+12 -1
View File
@@ -910,7 +910,18 @@ class ModuleWindow : public FormGroup {
// Model index
if (isModuleModelIndexAvailable(moduleIdx)) {
thirdColumn++;
new NumberEdit(this, grid.getFieldSlot(3, 0), 0, getMaxRxNum(moduleIdx), GET_SET_DEFAULT(g_model.header.modelId[moduleIdx]));
new NumberEdit(
this, grid.getFieldSlot(3, 0), 0, getMaxRxNum(moduleIdx),
GET_DEFAULT(g_model.header.modelId[moduleIdx]),
[=](int32_t newValue) {
if (newValue != g_model.header.modelId[moduleIdx]) {
g_model.header.modelId[moduleIdx] = newValue;
if (isModuleCrossfire(moduleIdx)) {
moduleState[moduleIdx].counter = CRSF_FRAME_MODELID;
}
SET_DIRTY();
}
});
}
if (isModuleBindRangeAvailable(moduleIdx)) {