1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 09:45:21 +03:00

isPowerAvailable prototype

This commit is contained in:
Bertrand Songis 2019-03-27 13:44:40 +01:00
parent ae35afd5c6
commit db6252ee79

View file

@ -89,11 +89,24 @@ void drawPower(coord_t x, coord_t y, int8_t dBm)
} }
} }
void menuModelModuleOptions(event_t event) bool isPowerAvailable(int value)
{ {
uint8_t modelId = reusableBuffer.hardwareAndSettings.modules[g_moduleIdx].information.modelID; uint8_t modelId = reusableBuffer.hardwareAndSettings.modules[g_moduleIdx].information.modelID;
uint8_t variant = reusableBuffer.hardwareAndSettings.modules[g_moduleIdx].information.variant; uint8_t variant = reusableBuffer.hardwareAndSettings.modules[g_moduleIdx].information.variant;
return (value == 10 /* 10 mW */ ||
value == 14 /* 25 mW */ ||
value == 20 /* 100 mW */ ||
value == 23 /* 200 mW */ ||
value == 27 /* 500 mW */ ||
value == 30 /* 1000 mW */);
}
void menuModelModuleOptions(event_t event)
{
uint8_t modelId = reusableBuffer.hardwareAndSettings.modules[g_moduleIdx].information.modelID;
// uint8_t variant = reusableBuffer.hardwareAndSettings.modules[g_moduleIdx].information.variant;
SUBMENU_NOTITLE(ITEM_MODULE_SETTINGS_COUNT, { SUBMENU_NOTITLE(ITEM_MODULE_SETTINGS_COUNT, {
IF_MODULE_OPTIONS(0, 0), IF_MODULE_OPTIONS(0, 0),
IF_MODULE_OPTIONS(1, 0), IF_MODULE_OPTIONS(1, 0),
@ -187,7 +200,7 @@ void menuModelModuleOptions(event_t event)
drawPower(lcdNextPos, y, reusableBuffer.hardwareAndSettings.moduleSettings.txPower); drawPower(lcdNextPos, y, reusableBuffer.hardwareAndSettings.moduleSettings.txPower);
lcdDrawText(lcdNextPos, y, ")"); lcdDrawText(lcdNextPos, y, ")");
if (attr) { if (attr) {
reusableBuffer.hardwareAndSettings.moduleSettings.txPower = checkIncDec(event, reusableBuffer.hardwareAndSettings.moduleSettings.txPower, 0, 30); reusableBuffer.hardwareAndSettings.moduleSettings.txPower = checkIncDec(event, reusableBuffer.hardwareAndSettings.moduleSettings.txPower, 0, 30, 0, &isPowerAvailable);
if (checkIncDec_Ret) { if (checkIncDec_Ret) {
reusableBuffer.hardwareAndSettings.moduleSettings.dirty = true; reusableBuffer.hardwareAndSettings.moduleSettings.dirty = true;
} }