@@ -529,12 +529,10 @@ void pulsesSendNextFrame(uint8_t module)
|
|||||||
pulsesEnableModule(module, protocol);
|
pulsesEnableModule(module, protocol);
|
||||||
moduleState[module].protocol = protocol;
|
moduleState[module].protocol = protocol;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mod = &(_module_drivers[module]);
|
auto mod = &(_module_drivers[module]);
|
||||||
if (mod->drv) {
|
if (mod->drv) {
|
||||||
|
|
||||||
auto drv = mod->drv;
|
auto drv = mod->drv;
|
||||||
auto ctx = mod->ctx;
|
auto ctx = mod->ctx;
|
||||||
|
|
||||||
@@ -545,7 +543,7 @@ void pulsesSendNextFrame(uint8_t module)
|
|||||||
|
|
||||||
uint8_t channelStart = g_model.moduleData[module].channelsStart;
|
uint8_t channelStart = g_model.moduleData[module].channelsStart;
|
||||||
int16_t* channels = &channelOutputs[channelStart];
|
int16_t* channels = &channelOutputs[channelStart];
|
||||||
uint8_t nChannels = 16; // TODO: MAX_CHANNELS - channelsStart
|
uint8_t nChannels = 16; // TODO: MAX_CHANNELS - channelsStart
|
||||||
|
|
||||||
auto buffer = _module_buffers[module]._buffer;
|
auto buffer = _module_buffers[module]._buffer;
|
||||||
drv->sendPulses(ctx, buffer, channels, nChannels);
|
drv->sendPulses(ctx, buffer, channels, nChannels);
|
||||||
|
|||||||
@@ -181,7 +181,9 @@ void mlinkSetDefault(int index, uint16_t id, uint8_t subId, uint8_t instance)
|
|||||||
storageDirty(EE_MODEL);
|
storageDirty(EE_MODEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void processExternalMLinkSerialData(uint8_t module, uint8_t data, uint8_t* buffer, uint8_t* len) {
|
void processExternalMLinkSerialData(uint8_t module, uint8_t data,
|
||||||
|
uint8_t* buffer, uint8_t* len)
|
||||||
|
{
|
||||||
static bool destuff = false; // byte requires adjustment
|
static bool destuff = false; // byte requires adjustment
|
||||||
static bool started = false; // start of frame detected
|
static bool started = false; // start of frame detected
|
||||||
|
|
||||||
|
|||||||
@@ -65,4 +65,5 @@ void processMLinkPacket(const uint8_t *packet, bool multi);
|
|||||||
// used by external MLink module driver
|
// used by external MLink module driver
|
||||||
#define PPM_MSB_BAUDRATE 115200
|
#define PPM_MSB_BAUDRATE 115200
|
||||||
|
|
||||||
void processExternalMLinkSerialData(uint8_t module, uint8_t data, uint8_t* buffer, uint8_t* len);
|
void processExternalMLinkSerialData(uint8_t module, uint8_t data,
|
||||||
|
uint8_t* buffer, uint8_t* len);
|
||||||
|
|||||||
@@ -775,7 +775,7 @@ void processDSMBindPacket(uint8_t module, const uint8_t *packet)
|
|||||||
storageDirty(EE_MODEL);
|
storageDirty(EE_MODEL);
|
||||||
|
|
||||||
moduleState[module].mode = MODULE_MODE_NORMAL;
|
moduleState[module].mode = MODULE_MODE_NORMAL;
|
||||||
restartModuleAsync(module, 50); // ~500ms
|
restartModuleAsync(module, 50); // ~500ms
|
||||||
}
|
}
|
||||||
#if defined(MULTIMODULE)
|
#if defined(MULTIMODULE)
|
||||||
else if (g_model.moduleData[module].type == MODULE_TYPE_MULTIMODULE &&
|
else if (g_model.moduleData[module].type == MODULE_TYPE_MULTIMODULE &&
|
||||||
|
|||||||
@@ -112,43 +112,42 @@ rxStatStruct *getRxStatLabels() {
|
|||||||
|
|
||||||
uint8_t moduleType = g_model.moduleData[moduleToUse].type;
|
uint8_t moduleType = g_model.moduleData[moduleToUse].type;
|
||||||
|
|
||||||
switch(moduleType) {
|
switch (moduleType) {
|
||||||
#if defined(MULTIMODULE)
|
#if defined(MULTIMODULE)
|
||||||
case MODULE_TYPE_MULTIMODULE: {
|
case MODULE_TYPE_MULTIMODULE: {
|
||||||
uint8_t multiProtocol = g_model.moduleData[moduleToUse].multi.rfProtocol;
|
uint8_t multiProtocol = g_model.moduleData[moduleToUse].multi.rfProtocol;
|
||||||
|
|
||||||
if (multiProtocol == MODULE_SUBTYPE_MULTI_FS_AFHDS2A ||
|
if (multiProtocol == MODULE_SUBTYPE_MULTI_FS_AFHDS2A ||
|
||||||
multiProtocol == MODULE_SUBTYPE_MULTI_HOTT ||
|
multiProtocol == MODULE_SUBTYPE_MULTI_HOTT ||
|
||||||
multiProtocol == MODULE_SUBTYPE_MULTI_MLINK) {
|
multiProtocol == MODULE_SUBTYPE_MULTI_MLINK) {
|
||||||
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
||||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
case MODULE_TYPE_PPM:
|
case MODULE_TYPE_PPM:
|
||||||
if(g_model.moduleData[moduleToUse].subType == PPM_PROTO_TLM_MLINK) {
|
if (g_model.moduleData[moduleToUse].subType == PPM_PROTO_TLM_MLINK) {
|
||||||
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
||||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODULE_TYPE_CROSSFIRE:
|
case MODULE_TYPE_CROSSFIRE:
|
||||||
case MODULE_TYPE_GHOST:
|
case MODULE_TYPE_GHOST:
|
||||||
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
||||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined (PCBNV14) && defined(AFHDS2)
|
#if defined(PCBNV14) && defined(AFHDS2)
|
||||||
case MODULE_TYPE_FLYSKY_AFHDS2A:
|
case MODULE_TYPE_FLYSKY_AFHDS2A:
|
||||||
extern uint32_t NV14internalModuleFwVersion;
|
extern uint32_t NV14internalModuleFwVersion;
|
||||||
|
|
||||||
if(moduleToUse == INTERNAL_MODULE) {
|
if (moduleToUse == INTERNAL_MODULE) {
|
||||||
if(NV14internalModuleFwVersion >= 0x1000E) {
|
if (NV14internalModuleFwVersion >= 0x1000E) {
|
||||||
rxStat.label = STR_RXSTAT_LABEL_SIGNAL;
|
rxStat.label = STR_RXSTAT_LABEL_SIGNAL;
|
||||||
rxStat.unit = STR_RXSTAT_UNIT_NOUNIT ;
|
rxStat.unit = STR_RXSTAT_UNIT_NOUNIT;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user