Merge pull request #991 from EdgeTX/access-options

Access options / menus
This commit is contained in:
Raphael Coeffic
2021-11-11 19:09:29 +01:00
committed by GitHub
14 changed files with 1393 additions and 482 deletions
+8 -2
View File
@@ -9,8 +9,6 @@ set(GUI_SRC
../common/stdlcd/model_inputs.cpp
../common/stdlcd/model_mixes.cpp
../common/stdlcd/view_text.cpp
../common/stdlcd/model_module_options.cpp
../common/stdlcd/model_receiver_options.cpp
../common/stdlcd/model_notes.cpp
../common/stdlcd/model_curves.cpp
../common/stdlcd/radio_hardware.cpp
@@ -55,3 +53,11 @@ if(PXX2 OR MULTIMODULE)
../common/stdlcd/radio_spectrum_analyser.cpp
)
endif()
if(PXX2)
set(GUI_SRC
${GUI_SRC}
../common/stdlcd/model_module_options.cpp
../common/stdlcd/model_receiver_options.cpp
)
endif()
@@ -61,30 +61,7 @@ enum {
bool isPowerAvailable(int value)
{
uint8_t modelId = reusableBuffer.hardwareAndSettings.modules[g_moduleIdx].information.modelID;
uint8_t variant = reusableBuffer.hardwareAndSettings.modules[g_moduleIdx].information.variant;
if (modelId == PXX2_MODULE_R9M_LITE) {
if (variant == PXX2_VARIANT_EU)
return (value == 14 /* 25 mW with telemetry */ ||
value == 20 /* 100 mW without telemetry */);
else
return value == 20; /* 100 mW */
}
else if (modelId == PXX2_MODULE_R9M || modelId == PXX2_MODULE_R9M_LITE_PRO) {
if (variant == PXX2_VARIANT_EU)
return (value == 14 /* 25 mW */ ||
value == 23 /* 200 mW */ ||
value == 27 /* 500 mW */);
else
return (value == 10 /* 10 mW */ ||
value == 20 /* 100 mW */ ||
value == 27 /* 500 mW */ ||
value == 30 /* 1000 mW */);
}
else {
return (value <= 20); /* 100 mW max for XJTs */
}
return isPXX2PowerAvailable(reusableBuffer.hardwareAndSettings.modules[g_moduleIdx].information, value);
}
void menuModelModuleOptions(event_t event)