fix: Allow compile without multimodule support (#3750)

This commit is contained in:
3djc
2023-07-03 19:07:02 +10:00
committed by GitHub
parent 1820ff8d5c
commit 8f0ad3fca8
6 changed files with 20 additions and 8 deletions
-2
View File
@@ -186,12 +186,10 @@
#define SP2UART_A_ID 0xFD00
#define SP2UART_B_ID 0xFD01
#if defined(MULTIMODULE)
// Virtual IDs, value can be changed to anything only used for display
#define RX_LQI_ID 0xFFFC
#define TX_LQI_ID 0xFFFD
#define TX_RSSI_ID 0xFFFE
#endif
// Default sensor data IDs (Physical IDs + CRC)
#define DATA_ID_VARIO 0x00 // 0
+5 -3
View File
@@ -562,7 +562,7 @@ void processSpektrumPacket(const uint8_t *packet)
return; // Not a sensor
}
#if defined(LUA)
#if defined(LUA) && defined(MULTIMODULE)
// Generic way for LUA Script to request ANY Specktrum Telemety Raw Data
// this can be used for TextGen or any other telemetry message
@@ -775,7 +775,9 @@ void processDSMBindPacket(uint8_t module, const uint8_t *packet)
moduleState[module].mode = MODULE_MODE_NORMAL;
restartModuleAsync(module, 50); // ~200ms
} else if (g_model.moduleData[module].type == MODULE_TYPE_MULTIMODULE &&
}
#if defined(MULTIMODULE)
else if (g_model.moduleData[module].type == MODULE_TYPE_MULTIMODULE &&
g_model.moduleData[module].multi.rfProtocol ==
MODULE_SUBTYPE_MULTI_DSM2 &&
g_model.moduleData[module].subType == MM_RF_DSM2_SUBTYPE_AUTO) {
@@ -817,7 +819,7 @@ void processDSMBindPacket(uint8_t module, const uint8_t *packet)
storageDirty(EE_MODEL);
}
#endif
debugval = packet[7] << 24 | packet[6] << 16 | packet[5] << 8 | packet[4];
/* log the bind packet as telemetry for quick debugging */
+5 -1
View File
@@ -50,6 +50,9 @@
#include "hitec.h"
#include "hott.h"
#include "multi.h"
#endif
#if defined(MULTIMODULE) || defined(PPM)
#include "mlink.h"
#endif
@@ -110,6 +113,7 @@ rxStatStruct *getRxStatLabels() {
uint8_t moduleType = g_model.moduleData[moduleToUse].type;
switch(moduleType) {
#if defined(MULTIMODULE)
case MODULE_TYPE_MULTIMODULE: {
uint8_t multiProtocol = g_model.moduleData[moduleToUse].multi.rfProtocol;
@@ -121,7 +125,7 @@ rxStatStruct *getRxStatLabels() {
}
}
break;
#endif
case MODULE_TYPE_PPM:
if(moduleState[moduleToUse].protocol == PROTOCOL_CHANNELS_PPM_MLINK) {
rxStat.label = STR_RXSTAT_LABEL_RQLY;
+4 -1
View File
@@ -45,6 +45,9 @@
#include "hitec.h"
#include "hott.h"
#include "multi.h"
#endif
#if defined(MULTIMODULE) || defined(PPM)
#include "mlink.h"
#endif
@@ -566,7 +569,7 @@ int setTelemetryValue(TelemetryProtocol protocol, uint16_t id, uint8_t subId,
break;
#endif
#if defined(MULTIMODULE) or defined(PPM)
#if defined(MULTIMODULE) || defined(PPM)
case PROTOCOL_TELEMETRY_MLINK:
mlinkSetDefault(index, id, subId, instance);
break;