1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 09:45:21 +03:00

Fix sending number of dam channels, give DSM2 debug telemetry output a better name

This commit is contained in:
Arne Schwabe 2016-10-08 15:26:09 +02:00
parent 543a1d14e8
commit a21d3e6f2e
13 changed files with 18 additions and 8 deletions

View file

@ -126,9 +126,11 @@ void setupPulsesMultimodule(uint8_t port)
protoByte |= MULTI_SEND_RANGECHECK;
// rfProtocol
if (g_model.moduleData[port].getMultiProtocol(true) == MM_RF_PROTO_DSM2 && g_model.moduleData[port].multi.autoBindMode && moduleFlag[port] == MODULE_BIND) {
if (g_model.moduleData[port].getMultiProtocol(true) == MM_RF_PROTO_DSM2){
// Autobinding should always be done in DSMX 11ms
subtype = MM_RF_DSM2_SUBTYPE_AUTO;
if(g_model.moduleData[port].multi.autoBindMode && moduleFlag[port] == MODULE_BIND)
subtype = MM_RF_DSM2_SUBTYPE_AUTO;
// The multi module wants the number of channels as options value and negative amount if the
// broken PRNG table is to be used.
@ -173,22 +175,19 @@ void setupPulsesMultimodule(uint8_t port)
sendByteMulti(0x54);
// protocol byte
protoByte |= (type & 0x1f);
if(g_model.moduleData[port].getMultiProtocol(true) != MM_RF_PROTO_DSM2)
protoByte |= (g_model.moduleData[port].multi.autoBindMode << 6);
sendByteMulti(protoByte);
// power always set to high (0 << 7)
// byte 2, subtype, powermode, model id
sendByteMulti((g_model.header.modelId[port] & 0x0f)
| ((subtype & 0x7) << 4)
| (g_model.moduleData[port].multi.lowPowerMode << 7)
);
// byte 3
sendByteMulti(optionValue);