Merge with latest 2.3
This commit is contained in:
@@ -22,27 +22,37 @@
|
||||
void onBindMenu(const char * result)
|
||||
{
|
||||
uint8_t moduleIdx = CURRENT_MODULE_EDITED(menuVerticalPosition - HEADER_LINE);
|
||||
uint8_t receiverTelemetryOff, receiverHigherChannels;
|
||||
|
||||
if (result == STR_BINDING_1_8_TELEM_ON) {
|
||||
g_model.moduleData[moduleIdx].pxx.receiverTelemetryOff = false;
|
||||
g_model.moduleData[moduleIdx].pxx.receiverHigherChannels = false;
|
||||
receiverTelemetryOff = false;
|
||||
receiverHigherChannels = false;
|
||||
}
|
||||
else if (result == STR_BINDING_1_8_TELEM_OFF) {
|
||||
g_model.moduleData[moduleIdx].pxx.receiverTelemetryOff = true;
|
||||
g_model.moduleData[moduleIdx].pxx.receiverHigherChannels = false;
|
||||
receiverTelemetryOff = true;
|
||||
receiverHigherChannels = false;
|
||||
}
|
||||
else if (result == STR_BINDING_9_16_TELEM_ON) {
|
||||
g_model.moduleData[moduleIdx].pxx.receiverTelemetryOff = false;
|
||||
g_model.moduleData[moduleIdx].pxx.receiverHigherChannels = true;
|
||||
receiverTelemetryOff = false;
|
||||
receiverHigherChannels = true;
|
||||
}
|
||||
else if (result == STR_BINDING_9_16_TELEM_OFF) {
|
||||
g_model.moduleData[moduleIdx].pxx.receiverTelemetryOff = true;
|
||||
g_model.moduleData[moduleIdx].pxx.receiverHigherChannels = true;
|
||||
receiverTelemetryOff = true;
|
||||
receiverHigherChannels = true;
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isModuleMultimodule(moduleIdx)) {
|
||||
g_model.moduleData[moduleIdx].multi.receiverTelemetryOff = receiverTelemetryOff;
|
||||
g_model.moduleData[moduleIdx].multi.receiverHigherChannels = receiverHigherChannels;
|
||||
}
|
||||
else {
|
||||
g_model.moduleData[moduleIdx].pxx.receiverTelemetryOff = receiverTelemetryOff;
|
||||
g_model.moduleData[moduleIdx].pxx.receiverHigherChannels = receiverHigherChannels;
|
||||
}
|
||||
|
||||
moduleState[moduleIdx].mode = MODULE_MODE_BIND;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,15 +25,20 @@ extern uint8_t g_moduleIdx;
|
||||
|
||||
bool addRadioTool(uint8_t index, const char * label)
|
||||
{
|
||||
int8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
LcdFlags attr = (sub == index ? INVERS : 0);
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + index * FH;
|
||||
lcdDrawNumber(3, y, index + 1, LEADING0|LEFT, 2);
|
||||
lcdDrawText(3*FW, y, label, (sub == index ? INVERS : 0));
|
||||
if (attr && s_editMode > 0) {
|
||||
s_editMode = 0;
|
||||
killAllEvents();
|
||||
return true;
|
||||
if (index >= menuVerticalOffset) {
|
||||
uint8_t lineIndex = index - menuVerticalOffset;
|
||||
if (lineIndex < NUM_BODY_LINES) {
|
||||
int8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
LcdFlags attr = (sub == index ? INVERS : 0);
|
||||
coord_t y = MENU_HEADER_HEIGHT + lineIndex * FH;
|
||||
lcdDrawNumber(3, y, index + 1, LEADING0 | LEFT, 2);
|
||||
lcdDrawText(3 * FW, y, label, (sub == index ? INVERS : 0));
|
||||
if (attr && s_editMode > 0) {
|
||||
s_editMode = 0;
|
||||
killAllEvents();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user