feat(mpm): remove FrSky special treatment madness (#3032)

This commit is contained in:
Raphael Coeffic
2023-01-26 11:44:46 +10:00
committed by GitHub
parent e380736197
commit 57bf180a9b
12 changed files with 83 additions and 301 deletions
+1 -3
View File
@@ -173,7 +173,6 @@ static int luaModelGetModule(lua_State *L)
if (module.type == MODULE_TYPE_MULTIMODULE) {
int protocol = g_model.moduleData[idx].multi.rfProtocol + 1;
int subprotocol = g_model.moduleData[idx].subType;
convertEtxProtocolToMulti(&protocol, &subprotocol); // Special treatment for the FrSky entry...
lua_pushtableinteger(L, "protocol", protocol);
lua_pushtableinteger(L, "subProtocol", subprotocol);
if (getMultiModuleStatus(idx).isValid()) {
@@ -246,8 +245,7 @@ static int luaModelSetModule(lua_State *L)
#endif
}
#if defined(MULTIMODULE)
if (protocol > 0 && subprotocol >= 0) { // Both are needed to compute etx protocol
convertMultiProtocolToEtx(&protocol, &subprotocol);
if (protocol > 0 && subprotocol >= 0) {
g_model.moduleData[idx].multi.rfProtocol = protocol - 1;
g_model.moduleData[idx].subType = subprotocol;
}