[Companion] 9XR-PRO EEPROM import fix

+ cosmetics
+ compilation error fixed on Manjaro
This commit is contained in:
Bertrand Songis
2017-01-22 09:09:15 +01:00
parent 2ffbb4e46c
commit 7140eec2df
4 changed files with 8 additions and 4 deletions
+1
View File
@@ -161,6 +161,7 @@ enum Capability {
HasTopLcd,
GlobalFunctions,
VirtualInputs,
InputsLength,
TrainerInputs,
RtcTime,
SportTelemetry,
@@ -234,7 +234,7 @@ class SourcesConversionTable: public ConversionTable {
addConversion(RawSource(SOURCE_TYPE_NONE), val++);
}
if (IS_STM32(board) && version >= 216) {
if ((IS_ARM(board) && version >= 218) || (IS_STM32(board) && version >= 216)) {
for (int i=0; i<32; i++) {
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
}
@@ -776,7 +776,7 @@ class HeliField: public StructField {
public:
HeliField(SwashRingData & heli, BoardEnum board, unsigned int version, unsigned int variant)
{
if (IS_STM32(board) && version >= 217) {
if ((IS_ARM(board) && version >= 218) || (IS_STM32(board) && version >= 217)) {
Append(new UnsignedField<8>(heli.type));
Append(new UnsignedField<8>(heli.value));
Append(new SourceField<8>(heli.collectiveSource, board, version, variant));
@@ -714,6 +714,8 @@ int OpenTxFirmware::getCapability(Capability capability)
return IS_ARM(board) ? 64 : 0;
case VirtualInputs:
return IS_ARM(board) ? 64 : 0;
case InputsLength:
return HAS_LARGE_LCD(board) ? 4 : 3;
case TrainerInputs:
return IS_ARM(board) ? 16 : 8;
case RtcTime:
+3 -2
View File
@@ -82,7 +82,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
}
if (firmware->getCapability(VirtualInputs)) {
ui->inputName->setMaxLength(4);
ui->inputName->setMaxLength(firmware->getCapability(InputsLength));
populateSourceCB(ui->sourceCB, ed->srcRaw, generalSettings, &model, POPULATE_NONE | POPULATE_SOURCES |
POPULATE_SWITCHES | POPULATE_TRIMS | POPULATE_TELEMETRY);
ui->sourceCB->removeItem(0);
@@ -127,8 +127,9 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
for (int i=0; i<9; i++) {
connect(cb_fp[i], SIGNAL(toggled(bool)), this, SLOT(valuesChanged()));
}
if (firmware->getCapability(VirtualInputs))
if (firmware->getCapability(VirtualInputs)) {
connect(ui->inputName, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
}
QTimer::singleShot(0, this, SLOT(shrink()));
}