Add support for R9M module (#5101)

* Implement R9M protocol according to PXX spec 1.7

Some of the things here are guesswork as I don’t have a R9M at hand. Also Companion support for the extra R9M options is not implemented yet.

* Fix build errors
This commit is contained in:
Arne Schwabe
2017-08-12 00:27:23 +02:00
committed by Bertrand Songis
parent 87295776ff
commit 51be7b000e
33 changed files with 244 additions and 120 deletions
@@ -105,6 +105,7 @@ class ProtocolsConversionTable: public ConversionTable
else if (IS_ARM(board)) {
val++;
addConversion(PULSES_MULTIMODULE, val++);
addConversion(PULSES_PXX_R9M, val++);
}
}
};
@@ -800,6 +800,7 @@ int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
case PULSES_PXX_XJT_X16:
case PULSES_PXX_XJT_D8:
case PULSES_PXX_XJT_LR12:
case PULSES_PXX_R9M:
//case PULSES_PXX_DJT: // Unavailable for now
case PULSES_LP45:
case PULSES_DSM2:
@@ -832,6 +833,7 @@ int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
case PULSES_PXX_XJT_X16:
case PULSES_PXX_XJT_D8:
case PULSES_PXX_XJT_LR12:
case PULSES_PXX_R9M:
case PULSES_LP45:
case PULSES_DSM2:
case PULSES_DSMX:
+4 -2
View File
@@ -261,7 +261,8 @@ ModulePanel::~ModulePanel()
bool ModulePanel::moduleHasFailsafes()
{
return ((PulsesProtocol)module.protocol == PulsesProtocol::PULSES_PXX_XJT_X16 && firmware->getCapability(HasFailsafe));;
return (((PulsesProtocol)module.protocol == PulsesProtocol::PULSES_PXX_XJT_X16 || (PulsesProtocol)module.protocol == PulsesProtocol::PULSES_PXX_R9M)
&& firmware->getCapability(HasFailsafe));;
}
void ModulePanel::setupFailsafes()
@@ -369,8 +370,9 @@ void ModulePanel::update()
case PULSES_PXX_XJT_D8:
case PULSES_PXX_XJT_LR12:
case PULSES_PXX_DJT:
case PULSES_PXX_R9M:
mask |= MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
if (protocol==PULSES_PXX_XJT_X16 || protocol==PULSES_PXX_XJT_LR12)
if (protocol==PULSES_PXX_XJT_X16 || protocol==PULSES_PXX_XJT_LR12 || protocol==PULSES_PXX_R9M)
mask |= MASK_RX_NUMBER;
if (IS_HORUS(firmware->getBoard()) && moduleIdx==0)
mask |= MASK_ANTENNA;
+2 -1
View File
@@ -119,7 +119,8 @@ QString ModelPrinter::printModuleProtocol(unsigned int protocol)
"PPM16", "PPMsim",
"FrSky XJT (D16)", "FrSky XJT (D8)", "FrSky XJT (LR12)", "FrSky DJT",
"Crossfire",
"DIY Multiprotocol Module"
"DIY Multiprotocol Module",
"FrSky R9M Module"
};
return CHECK_IN_ARRAY(strings, protocol);
+1
View File
@@ -774,6 +774,7 @@ enum PulsesProtocol {
PULSES_PXX_DJT,
PULSES_CROSSFIRE,
PULSES_MULTIMODULE,
PULSES_PXX_R9M,
PULSES_PROTOCOL_LAST
};