WiP: Simu and modules fixes

This commit is contained in:
Raphael Coeffic
2021-07-25 08:33:57 +02:00
parent f99389c4a2
commit 74f2445558
16 changed files with 67 additions and 13 deletions
+2 -2
View File
@@ -48,7 +48,7 @@ void CurveDataEdit::update()
uint8_t curvePointsCount = 5 + curve.points;
// Point number
for (uint8_t i = 0; i < curvePointsCount; i++) {
for (int i = 0; i < curvePointsCount; i++) {
auto txt = new StaticText(
this,
{i * boxWidth + PAGE_PADDING, 10, boxWidth - PAGE_PADDING, boxHeight},
@@ -60,7 +60,7 @@ void CurveDataEdit::update()
// x value
if (curve.type == CURVE_TYPE_CUSTOM) {
// Adjustable points for custom curves
for (uint8_t i = 0; i < curvePointsCount; i++) {
for (int i = 0; i < curvePointsCount; i++) {
int8_t* points = curveAddress(index);
auto pointEdit = new NumberEdit(
this,
+10
View File
@@ -622,6 +622,16 @@ class ModuleWindow : public FormGroup {
rfChoice->setFocus(SET_FOCUS_DEFAULT);
});
}
else if (isModuleFlySky(moduleIdx)) {
rfChoice = new Choice(this, grid.getFieldSlot(2, 1), STR_FLYSKY_PROTOCOLS, 0, MODULE_SUBTYPE_ISRM_PXX2_ACCST_LR12,
GET_DEFAULT(g_model.moduleData[moduleIdx].subType),
[=](int32_t newValue) {
g_model.moduleData[moduleIdx].subType = newValue;
SET_DIRTY();
update();
rfChoice->setFocus(SET_FOCUS_DEFAULT);
});
}
#if defined(MULTIMODULE)
else if (isModuleMultimodule(moduleIdx)) {
Choice * mmSubProtocol = nullptr;
+7
View File
@@ -628,6 +628,13 @@ bool isInternalModuleAvailable(int moduleType)
return true;
#endif
}
#if (defined(AFHDS3) || defined(AFHDS2A)) && (defined(INTERNAL_MODULE_AFHDS2A) || defined(INTERNAL_MODULE_AFHDS3))
if (moduleType == MODULE_TYPE_AFHDS3) {
return true;
}
#endif
return false;
}
#else