@@ -529,12 +529,10 @@ void pulsesSendNextFrame(uint8_t module)
|
||||
pulsesEnableModule(module, protocol);
|
||||
moduleState[module].protocol = protocol;
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
auto mod = &(_module_drivers[module]);
|
||||
if (mod->drv) {
|
||||
|
||||
auto drv = mod->drv;
|
||||
auto ctx = mod->ctx;
|
||||
|
||||
@@ -542,10 +540,10 @@ void pulsesSendNextFrame(uint8_t module)
|
||||
if (drv->onConfigChange) drv->onConfigChange(ctx);
|
||||
state.settings_updated = 0;
|
||||
}
|
||||
|
||||
|
||||
uint8_t channelStart = g_model.moduleData[module].channelsStart;
|
||||
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;
|
||||
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);
|
||||
}
|
||||
|
||||
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 started = false; // start of frame detected
|
||||
|
||||
|
||||
@@ -65,4 +65,5 @@ void processMLinkPacket(const uint8_t *packet, bool multi);
|
||||
// used by external MLink module driver
|
||||
#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);
|
||||
|
||||
moduleState[module].mode = MODULE_MODE_NORMAL;
|
||||
restartModuleAsync(module, 50); // ~500ms
|
||||
restartModuleAsync(module, 50); // ~500ms
|
||||
}
|
||||
#if defined(MULTIMODULE)
|
||||
else if (g_model.moduleData[module].type == MODULE_TYPE_MULTIMODULE &&
|
||||
|
||||
@@ -112,45 +112,44 @@ rxStatStruct *getRxStatLabels() {
|
||||
|
||||
uint8_t moduleType = g_model.moduleData[moduleToUse].type;
|
||||
|
||||
switch(moduleType) {
|
||||
switch (moduleType) {
|
||||
#if defined(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 ||
|
||||
multiProtocol == MODULE_SUBTYPE_MULTI_HOTT ||
|
||||
multiProtocol == MODULE_SUBTYPE_MULTI_MLINK) {
|
||||
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||
}
|
||||
if (multiProtocol == MODULE_SUBTYPE_MULTI_FS_AFHDS2A ||
|
||||
multiProtocol == MODULE_SUBTYPE_MULTI_HOTT ||
|
||||
multiProtocol == MODULE_SUBTYPE_MULTI_MLINK) {
|
||||
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
#endif
|
||||
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.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||
}
|
||||
break;
|
||||
|
||||
case MODULE_TYPE_CROSSFIRE:
|
||||
case MODULE_TYPE_GHOST:
|
||||
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||
break;
|
||||
|
||||
#if defined (PCBNV14) && defined(AFHDS2)
|
||||
#if defined(PCBNV14) && defined(AFHDS2)
|
||||
case MODULE_TYPE_FLYSKY_AFHDS2A:
|
||||
extern uint32_t NV14internalModuleFwVersion;
|
||||
extern uint32_t NV14internalModuleFwVersion;
|
||||
|
||||
if(moduleToUse == INTERNAL_MODULE) {
|
||||
if(NV14internalModuleFwVersion >= 0x1000E) {
|
||||
rxStat.label = STR_RXSTAT_LABEL_SIGNAL;
|
||||
rxStat.unit = STR_RXSTAT_UNIT_NOUNIT ;
|
||||
}
|
||||
if (moduleToUse == INTERNAL_MODULE) {
|
||||
if (NV14internalModuleFwVersion >= 0x1000E) {
|
||||
rxStat.label = STR_RXSTAT_LABEL_SIGNAL;
|
||||
rxStat.unit = STR_RXSTAT_UNIT_NOUNIT;
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
return &rxStat;
|
||||
|
||||
Reference in New Issue
Block a user