feat: Support for ext. Multiplex MLink JR type module (#3352)

* introducing external MLink module telemetry as module PPM subtype

* implemented fix for sensor discovery display not showing all detected sensors (is in separate PR too)

implemented PPM subtypes in Companion

* add PPM subtype to model printer

finalize subtypes for PPM in Companion

* added logic to try to use HW UART with inverters turned off first (e.g. NV14), then, if not successfull use soft serial inverted (== uninverted data due to HW inverters on PCB)

changed start bit detection IRQ priority from 5 to the previous 0 (also in separate PR)

* extended telemetry timeout to 2s due to slow Mlink RSSI update rate

* changed the "NOTLM" sub-type texts to:

- "No Telem" for 128x64 (this is the max numbers of characters it can take)
- "No Telemetry" everything else including Companion

* Companion:

- lower case 1st charachter on PpmSubTypeStrings to ppmSubTypeStrings
- added telemetry hooks for ppmSubTypeStrings stringx

* simplified serial port initialization for MLink telemetry

* editorial change: corrected obsolete comment
This commit is contained in:
Michael
2023-05-16 11:22:47 +10:00
committed by GitHub
parent 3d6bc638a6
commit 5db37e2a2b
21 changed files with 231 additions and 14 deletions
@@ -86,6 +86,11 @@ static const YamlLookupTable r9mLut = {
{ MODULE_SUBTYPE_R9M_AUPLUS, "AUPLUS" },
};
static const YamlLookupTable ppmLut = {
{ 0, "NOTLM" },
{ 1, "MLINK" }
};
static const YamlLookupTable dsmLut = {
{ 0, "LP45" },
{ 1, "DSM2" },
@@ -240,6 +245,9 @@ Node convert<ModuleData>::encode(const ModuleData& rhs)
case PULSES_LP45:
node["subType"] = LookupValue(dsmLut, subtype);
break;
case PULSES_PPM:
node["subType"] = LookupValue(ppmLut, subtype);
break;
case PULSES_MULTIMODULE: {
int rfProtocol = rhs.multi.rfProtocol + 1;
int subType = rhs.subType;
@@ -355,6 +363,9 @@ bool convert<ModuleData>::decode(const Node& node, ModuleData& rhs)
case PULSES_PXX_R9M_LITE: {
subType >> r9mLut >> rhs.subType;
} break;
case PULSES_PPM: {
subType >> ppmLut >> rhs.subType;
} break;
case PULSES_LP45: {
int subProto = 0;
subType >> dsmLut >> subProto;
+7
View File
@@ -247,12 +247,19 @@ QString ModuleData::subTypeToString(int type) const
"915MHz"
};
static const QString ppmSubTypeStrings[PPM_NUM_SUBTYPES] = {
tr("No Telemetry"),
tr("MLink")
};
if (type < 0)
type = subType;
switch (protocol) {
case PULSES_MULTIMODULE:
return Multiprotocols::subTypeToString((int)multi.rfProtocol, (unsigned)type);
case PULSES_PPM:
return CHECK_IN_ARRAY(ppmSubTypeStrings, type);
case PULSES_PXX_R9M:
return CHECK_IN_ARRAY(strings, type);
case PULSES_AFHDS3:
+2
View File
@@ -191,6 +191,8 @@ enum ModuleSubtypeR9M {
MODULE_SUBTYPE_R9M_LAST=MODULE_SUBTYPE_R9M_AUPLUS
};
#define PPM_NUM_SUBTYPES 2
constexpr int PXX2_MAX_RECEIVERS_PER_MODULE = 3;
constexpr int PXX2_LEN_RX_NAME = 8;
+4 -1
View File
@@ -488,7 +488,7 @@ void ModulePanel::update()
ui->telemetryBaudrate->setField(module.ghost.telemetryBaudrate);
break;
case PULSES_PPM:
mask |= MASK_PPM_FIELDS | MASK_SBUSPPM_FIELDS| MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT;
mask |= MASK_SUBTYPES | MASK_PPM_FIELDS | MASK_SBUSPPM_FIELDS| MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT;
if (IS_9XRPRO(board)) {
mask |= MASK_OPEN_DRAIN;
}
@@ -626,6 +626,9 @@ void ModulePanel::update()
case PULSES_AFHDS3:
numEntries = 4;
break;
case PULSES_PPM:
numEntries = PPM_NUM_SUBTYPES;
break;
default:
break;
}
+2
View File
@@ -205,6 +205,8 @@ QString ModelPrinter::printModule(int idx)
else {
str << printLabelValue(tr("Protocol"), ModuleData::protocolToString(module.protocol));
if (module.protocol) {
if (module.protocol == PULSES_PPM)
str << printLabelValue(tr("Sub Type"), module.subTypeToString());
str << printLabelValue(tr("Channels"), QString("%1-%2").arg(module.channelsStart + 1).arg(module.channelsStart + module.channelsCount));
if (module.protocol == PULSES_PPM || module.protocol == PULSES_SBUS) {
str << printLabelValue(tr("Frame length"), QString("%1ms").arg(printPPMFrameLength(module.ppm.frameLength)));