mirror of
https://github.com/opentx/opentx.git
synced 2025-07-19 14:25:11 +03:00
Many fixes
This commit is contained in:
parent
307c8d7daf
commit
ed1d312f20
6 changed files with 23 additions and 14 deletions
|
@ -2067,7 +2067,7 @@ void onRxOptionsUpdateConfirm(const char * result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MenuModelReceiverOptionsItems {
|
enum {
|
||||||
ITEM_RECEIVER_TELEMETRY,
|
ITEM_RECEIVER_TELEMETRY,
|
||||||
ITEM_RECEIVER_PWM_RATE,
|
ITEM_RECEIVER_PWM_RATE,
|
||||||
ITEM_RECEIVER_PINMAP_FIRST
|
ITEM_RECEIVER_PINMAP_FIRST
|
||||||
|
@ -2092,7 +2092,7 @@ void menuModelReceiverOptions(event_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reusableBuffer.moduleSettings.dirty == 2 && reusableBuffer.receiverSettings.state == PXX2_SETTINGS_OK) {
|
if (reusableBuffer.receiverSettings.dirty == 2 && reusableBuffer.receiverSettings.state == PXX2_SETTINGS_OK) {
|
||||||
popMenu();
|
popMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,10 @@ void menuRadioModulesVersion(event_t event)
|
||||||
// Module model
|
// Module model
|
||||||
if (y >= MENU_BODY_TOP && y < MENU_BODY_BOTTOM) {
|
if (y >= MENU_BODY_TOP && y < MENU_BODY_BOTTOM) {
|
||||||
lcdDrawText(INDENT_WIDTH, y, "Model");
|
lcdDrawText(INDENT_WIDTH, y, "Model");
|
||||||
lcdDrawText(12 * FW, y, modulesModels[reusableBuffer.hardware.modules[module].modelID]);
|
uint8_t modelId = reusableBuffer.hardware.modules[module].modelID;
|
||||||
|
if (modelId >= DIM(modulesModels))
|
||||||
|
modelId = 0;
|
||||||
|
lcdDrawText(12 * FW, y, modulesModels[modelId]);
|
||||||
}
|
}
|
||||||
y += FH;
|
y += FH;
|
||||||
|
|
||||||
|
@ -151,7 +154,10 @@ void menuRadioModulesVersion(event_t event)
|
||||||
if (y >= MENU_BODY_TOP && y < MENU_BODY_BOTTOM) {
|
if (y >= MENU_BODY_TOP && y < MENU_BODY_BOTTOM) {
|
||||||
lcdDrawText(INDENT_WIDTH, y, "Receiver");
|
lcdDrawText(INDENT_WIDTH, y, "Receiver");
|
||||||
lcdDrawNumber(lcdLastRightPos + 2, y, receiver + 1);
|
lcdDrawNumber(lcdLastRightPos + 2, y, receiver + 1);
|
||||||
lcdDrawText(12 * FW, y, receiversModels[reusableBuffer.hardware.modules[module].receivers[receiver].modelID]);
|
uint8_t modelId = reusableBuffer.hardware.modules[module].receivers[receiver].modelID;
|
||||||
|
if (modelId >= DIM(receiversModels))
|
||||||
|
modelId = 0;
|
||||||
|
lcdDrawText(12 * FW, y, receiversModels[modelId]);
|
||||||
}
|
}
|
||||||
y += FH;
|
y += FH;
|
||||||
|
|
||||||
|
|
|
@ -156,9 +156,10 @@ void runPopupWarning(event_t event)
|
||||||
if (warningType == WARNING_TYPE_CONFIRM) {
|
if (warningType == WARNING_TYPE_CONFIRM) {
|
||||||
warningType = WARNING_TYPE_ASTERISK;
|
warningType = WARNING_TYPE_ASTERISK;
|
||||||
warningText = nullptr;
|
warningText = nullptr;
|
||||||
warningResult = true;
|
|
||||||
if (popupMenuHandler)
|
if (popupMenuHandler)
|
||||||
popupMenuHandler(STR_OK);
|
popupMenuHandler(STR_OK);
|
||||||
|
else
|
||||||
|
warningResult = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// no break
|
// no break
|
||||||
|
|
|
@ -1138,12 +1138,12 @@ union ReusableBuffer
|
||||||
} moduleSetup;
|
} moduleSetup;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
uint8_t state; // 0x00 = READ 0x40 = WRITE
|
uint8_t state; // 0x00 = READ 0x40 = WRITE
|
||||||
tmr10ms_t timeout;
|
tmr10ms_t timeout;
|
||||||
uint8_t dirty;
|
uint8_t dirty;
|
||||||
uint8_t rfProtocol;
|
uint8_t rfProtocol;
|
||||||
uint8_t externalAntenna;
|
uint8_t externalAntenna;
|
||||||
int8_t txPower;
|
int8_t txPower;
|
||||||
} moduleSettings;
|
} moduleSettings;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
|
@ -192,7 +192,7 @@ inline bool isModuleDSM2(uint8_t idx)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// order is the same as in enum Protocols in myeeprom.h (none, ppm, pxx, pxx2, dsm, crossfire, multi, r9m, r9m2, sbus)
|
// order is the same as in enum Protocols in myeeprom.h (none, ppm, pxx, pxx2, dsm, crossfire, multi, r9m, r9m2, sbus)
|
||||||
static const int8_t maxChannelsModules[] = { 0, 8, 8, 8, -2, 8, 4, 8, 8, 8}; // relative to 8!
|
static const int8_t maxChannelsModules[] = { 0, 8, 8, 16, -2, 8, 4, 8, 16, 8}; // relative to 8!
|
||||||
static const int8_t maxChannelsXJT[] = { 0, 8, 0, 4 }; // relative to 8!
|
static const int8_t maxChannelsXJT[] = { 0, 8, 0, 4 }; // relative to 8!
|
||||||
|
|
||||||
constexpr int8_t MAX_TRAINER_CHANNELS_M8 = MAX_TRAINER_CHANNELS - 8;
|
constexpr int8_t MAX_TRAINER_CHANNELS_M8 = MAX_TRAINER_CHANNELS - 8;
|
||||||
|
@ -216,6 +216,8 @@ inline int8_t defaultModuleChannels_M8(uint8_t idx)
|
||||||
return 0; // 8 channels
|
return 0; // 8 channels
|
||||||
else if (isModuleMultimoduleDSM2(idx))
|
else if (isModuleMultimoduleDSM2(idx))
|
||||||
return -1; // 7 channels
|
return -1; // 7 channels
|
||||||
|
else if (isModulePXX2(idx))
|
||||||
|
return 8; // 16 channels
|
||||||
else
|
else
|
||||||
return maxModuleChannels_M8(idx);
|
return maxModuleChannels_M8(idx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,9 +191,9 @@ void Pxx2Pulses::setupReceiverSettingsFrame(uint8_t module)
|
||||||
if (reusableBuffer.receiverSettings.pwmRate)
|
if (reusableBuffer.receiverSettings.pwmRate)
|
||||||
flag1 |= PXX2_RX_SETTINGS_FLAG1_FASTPWM;
|
flag1 |= PXX2_RX_SETTINGS_FLAG1_FASTPWM;
|
||||||
Pxx2Transport::addByte(flag1);
|
Pxx2Transport::addByte(flag1);
|
||||||
uint8_t outputsCount = min<uint8_t>(16, reusableBuffer.receiverSettings.outputsCount);
|
uint8_t outputsCount = min<uint8_t>(24, reusableBuffer.receiverSettings.outputsCount);
|
||||||
for (int i = 0; i < outputsCount; i++) {
|
for (int i = 0; i < outputsCount; i++) {
|
||||||
Pxx2Transport::addByte(reusableBuffer.receiverSettings.outputsMapping[i]);
|
Pxx2Transport::addByte(min<uint8_t>(23, reusableBuffer.receiverSettings.outputsMapping[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reusableBuffer.receiverSettings.timeout = get_tmr10ms() + 200/*next try in 2s*/;
|
reusableBuffer.receiverSettings.timeout = get_tmr10ms() + 200/*next try in 2s*/;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue