Fix timing of Multi and DSM2 protocol

We send an extra stopbit and the logic for driving the transistor was swapped. Thanks Mike for noticing (http://www.rcgroups.com/forums/showpost.php?p=35671709&postcount=5151)
This commit is contained in:
Arne Schwabe
2016-09-08 20:24:22 +02:00
parent 753b12f886
commit de3db6eec0
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -64,7 +64,7 @@ void sendByteDsm2(uint8_t b) // max 10 changes 0 10 10 10 10 1
}
b = (b>>1) | 0x80; // shift in stop bit
}
_send_1(len+BITLEN_DSM2); // stop bit
_send_1(len); // stop bit (len is already BITLEN_DSM2)
}
void putDsm2Flush()
@@ -118,7 +118,7 @@ void setupPulsesDSM2(uint8_t port)
modulePulsesData[EXTERNAL_MODULE].dsm2.serialByte = 0 ;
modulePulsesData[EXTERNAL_MODULE].dsm2.serialBitCount = 0 ;
#else
modulePulsesData[EXTERNAL_MODULE].dsm2.index = 1;
modulePulsesData[EXTERNAL_MODULE].dsm2.index = 0;
modulePulsesData[EXTERNAL_MODULE].dsm2.rest = 44000;
#endif
+2 -2
View File
@@ -87,7 +87,7 @@ static void sendByteMulti(uint8_t b) //max 11 changes 0 10 10 10 10 P 1
if (i==7)
b = b ^ parity; // lowest bit is one from previous line
}
_send_level(len+2*BITLEN_MULTI); // 2Stop bits
_send_level(len+ BITLEN_MULTI); // enlarge the last bit to be two stop bits long
}
#endif
@@ -106,7 +106,7 @@ void setupPulsesMultimodule(uint8_t port)
modulePulsesData[EXTERNAL_MODULE].dsm2.serialBitCount = 0 ;
#else
modulePulsesData[EXTERNAL_MODULE].dsm2.rest = 18000; // 9ms refresh
modulePulsesData[EXTERNAL_MODULE].dsm2.index = 1;
modulePulsesData[EXTERNAL_MODULE].dsm2.index = 0;
#endif
modulePulsesData[EXTERNAL_MODULE].dsm2.ptr = modulePulsesData[EXTERNAL_MODULE].dsm2.pulses;