Merge pull request #3022 from opentx/kilrah/protocol_fixes
Kilrah/protocol fixes
This commit is contained in:
@@ -1391,8 +1391,6 @@ class EEPROMInterface
|
|||||||
|
|
||||||
virtual int getSize(const GeneralSettings &) = 0;
|
virtual int getSize(const GeneralSettings &) = 0;
|
||||||
|
|
||||||
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
|
|
||||||
|
|
||||||
virtual const int getEEpromSize() = 0;
|
virtual const int getEEpromSize() = 0;
|
||||||
|
|
||||||
virtual const int getMaxModels() = 0;
|
virtual const int getMaxModels() = 0;
|
||||||
@@ -1628,6 +1626,8 @@ class Firmware {
|
|||||||
|
|
||||||
virtual bool isTelemetrySourceAvailable(int source) = 0;
|
virtual bool isTelemetrySourceAvailable(int source) = 0;
|
||||||
|
|
||||||
|
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QList<const char *> languages;
|
QList<const char *> languages;
|
||||||
QList<const char *> ttslanguages;
|
QList<const char *> ttslanguages;
|
||||||
|
|||||||
@@ -816,7 +816,7 @@ bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int OpenTxEepromInterface::isAvailable(PulsesProtocol proto, int port)
|
int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
|
||||||
{
|
{
|
||||||
if (IS_TARANIS(board)) {
|
if (IS_TARANIS(board)) {
|
||||||
switch (port) {
|
switch (port) {
|
||||||
@@ -827,6 +827,8 @@ int OpenTxEepromInterface::isAvailable(PulsesProtocol proto, int port)
|
|||||||
case PULSES_PXX_XJT_D8:
|
case PULSES_PXX_XJT_D8:
|
||||||
case PULSES_PXX_XJT_LR12:
|
case PULSES_PXX_XJT_LR12:
|
||||||
return 1;
|
return 1;
|
||||||
|
case PULSES_PPM:
|
||||||
|
return id.contains("internalppm") ? 1 : 0;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -893,7 +895,7 @@ int OpenTxEepromInterface::isAvailable(PulsesProtocol proto, int port)
|
|||||||
case PULSES_DSMX:
|
case PULSES_DSMX:
|
||||||
case PULSES_LP45:
|
case PULSES_LP45:
|
||||||
case PULSES_DSM2:
|
case PULSES_DSM2:
|
||||||
case PULSES_PXX_DJT:
|
// case PULSES_PXX_DJT: // Unavailable for now
|
||||||
case PULSES_PPM16:
|
case PULSES_PPM16:
|
||||||
case PULSES_PPMSIM:
|
case PULSES_PPMSIM:
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ class OpenTxEepromInterface : public EEPROMInterface
|
|||||||
|
|
||||||
virtual int getSize(const GeneralSettings &);
|
virtual int getSize(const GeneralSettings &);
|
||||||
|
|
||||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
const char * getName();
|
const char * getName();
|
||||||
@@ -123,6 +121,8 @@ class OpenTxFirmware: public Firmware {
|
|||||||
|
|
||||||
virtual bool isTelemetrySourceAvailable(int source);
|
virtual bool isTelemetrySourceAvailable(int source);
|
||||||
|
|
||||||
|
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
QString getFirmwareBaseUrl();
|
QString getFirmwareBaseUrl();
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
|
|||||||
|
|
||||||
// The protocols available on this board
|
// The protocols available on this board
|
||||||
for (int i=0; i<PULSES_PROTOCOL_LAST; i++) {
|
for (int i=0; i<PULSES_PROTOCOL_LAST; i++) {
|
||||||
if (GetEepromInterface()->isAvailable((PulsesProtocol)i, moduleIdx)) {
|
if (firmware->isAvailable((PulsesProtocol)i, moduleIdx)) {
|
||||||
ui->protocol->addItem(ModelPrinter::printModuleProtocol(i), (QVariant)i);
|
ui->protocol->addItem(ModelPrinter::printModuleProtocol(i), (QVariant)i);
|
||||||
if (i == module.protocol) ui->protocol->setCurrentIndex(ui->protocol->count()-1);
|
if (i == module.protocol) ui->protocol->setCurrentIndex(ui->protocol->count()-1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user