From f525b1762bdee813e008a7dcaa2f4542760ebe43 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 1 May 2017 00:33:45 +0200 Subject: [PATCH] Fix #4881 (#4884) Thanks Mike for noticing: In pxx_arm.cpp, the pulse duration is set to either 48 or 32. This value gets put into the ARR register of the timer (via DMA). Counters count from 0 to the ARR value, then go back to 0. This will result in either 49 or 33 counts for the pulse width, thus making the pulses 0.5uS too long. Tested only with external PXX --- radio/src/pulses/pxx_arm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/pulses/pxx_arm.cpp b/radio/src/pulses/pxx_arm.cpp index cbb4f4585..b0f15155e 100644 --- a/radio/src/pulses/pxx_arm.cpp +++ b/radio/src/pulses/pxx_arm.cpp @@ -134,7 +134,7 @@ void pxxPutPcmTail(uint8_t port) #else void pxxPutPcmPart(uint8_t port, uint8_t value) { - pulse_duration_t duration = value ? 48 : 32; + pulse_duration_t duration = value ? 47 : 31; *modulePulsesData[port].pxx.ptr++ = duration; modulePulsesData[port].pxx.rest -= duration + 1; }