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:
@@ -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
|
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()
|
void putDsm2Flush()
|
||||||
@@ -118,7 +118,7 @@ void setupPulsesDSM2(uint8_t port)
|
|||||||
modulePulsesData[EXTERNAL_MODULE].dsm2.serialByte = 0 ;
|
modulePulsesData[EXTERNAL_MODULE].dsm2.serialByte = 0 ;
|
||||||
modulePulsesData[EXTERNAL_MODULE].dsm2.serialBitCount = 0 ;
|
modulePulsesData[EXTERNAL_MODULE].dsm2.serialBitCount = 0 ;
|
||||||
#else
|
#else
|
||||||
modulePulsesData[EXTERNAL_MODULE].dsm2.index = 1;
|
modulePulsesData[EXTERNAL_MODULE].dsm2.index = 0;
|
||||||
modulePulsesData[EXTERNAL_MODULE].dsm2.rest = 44000;
|
modulePulsesData[EXTERNAL_MODULE].dsm2.rest = 44000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ static void sendByteMulti(uint8_t b) //max 11 changes 0 10 10 10 10 P 1
|
|||||||
if (i==7)
|
if (i==7)
|
||||||
b = b ^ parity; // lowest bit is one from previous line
|
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
|
#endif
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ void setupPulsesMultimodule(uint8_t port)
|
|||||||
modulePulsesData[EXTERNAL_MODULE].dsm2.serialBitCount = 0 ;
|
modulePulsesData[EXTERNAL_MODULE].dsm2.serialBitCount = 0 ;
|
||||||
#else
|
#else
|
||||||
modulePulsesData[EXTERNAL_MODULE].dsm2.rest = 18000; // 9ms refresh
|
modulePulsesData[EXTERNAL_MODULE].dsm2.rest = 18000; // 9ms refresh
|
||||||
modulePulsesData[EXTERNAL_MODULE].dsm2.index = 1;
|
modulePulsesData[EXTERNAL_MODULE].dsm2.index = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
modulePulsesData[EXTERNAL_MODULE].dsm2.ptr = modulePulsesData[EXTERNAL_MODULE].dsm2.pulses;
|
modulePulsesData[EXTERNAL_MODULE].dsm2.ptr = modulePulsesData[EXTERNAL_MODULE].dsm2.pulses;
|
||||||
|
|||||||
Reference in New Issue
Block a user