From c0cc4e250ef9afe27456fa178f8d67a784c0134e Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 8 Sep 2016 23:01:13 +0200 Subject: [PATCH] Fix polarity for last pulse with DSM2/Multi The DSM/Multi timing changed the index to begin with 0 instead of 1 and that broke the putDSM2Flush logic --- radio/src/pulses/dsm2_arm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/pulses/dsm2_arm.cpp b/radio/src/pulses/dsm2_arm.cpp index 176312cd8..b240e33ba 100644 --- a/radio/src/pulses/dsm2_arm.cpp +++ b/radio/src/pulses/dsm2_arm.cpp @@ -70,9 +70,9 @@ void sendByteDsm2(uint8_t b) // max 10 changes 0 10 10 10 10 1 void putDsm2Flush() { if (modulePulsesData[EXTERNAL_MODULE].dsm2.index & 1) - *(modulePulsesData[EXTERNAL_MODULE].dsm2.ptr - 1) = modulePulsesData[EXTERNAL_MODULE].dsm2.rest; - else *modulePulsesData[EXTERNAL_MODULE].dsm2.ptr++ = modulePulsesData[EXTERNAL_MODULE].dsm2.rest; + else + *(modulePulsesData[EXTERNAL_MODULE].dsm2.ptr - 1) = modulePulsesData[EXTERNAL_MODULE].dsm2.rest; } #else void putDsm2SerialBit(uint8_t bit)