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
+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;