From 6c0a9714fc85237af9d17b0b44ee1348c315f08d Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 5 Aug 2015 21:43:24 +0200 Subject: [PATCH] [9XR-PRO] Wrong code comment Thanks project2gglider! It was a copy-paste from Mike's code. When I will have spare time I will replace those numbers by constants... --- radio/src/targets/sky9x/pulses_driver.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/radio/src/targets/sky9x/pulses_driver.cpp b/radio/src/targets/sky9x/pulses_driver.cpp index 2dcb08917..221fd8baf 100644 --- a/radio/src/targets/sky9x/pulses_driver.cpp +++ b/radio/src/targets/sky9x/pulses_driver.cpp @@ -179,7 +179,7 @@ void disable_ssc() void init_pxx(uint32_t port) { if (port == EXTERNAL_MODULE) { - init_main_ppm(5000, 0); + init_main_ppm(2500 * 2, 0); init_ssc(); } else { @@ -201,7 +201,7 @@ void disable_pxx(uint32_t port) void init_dsm2(uint32_t port) { if (port == EXTERNAL_MODULE) { - init_main_ppm(5000, 0); + init_main_ppm(2500 * 2, 0); init_ssc(); } else { @@ -234,16 +234,16 @@ extern "C" void PWM_IRQHandler(void) // Use the current protocol, don't switch until set_up_pulses switch (s_current_protocol[EXTERNAL_MODULE]) { case PROTO_PXX: - // Alternate periods of 15.5mS and 2.5 mS + // Alternate periods of 6.5mS and 2.5 mS period = pwmptr->PWM_CH_NUM[3].PWM_CPDR; - if (period == 5000) { // 2.5 mS + if (period == 2500 * 2) { period = 6500 * 2; } else { - period = 5000; + period = 2500 * 2; } pwmptr->PWM_CH_NUM[3].PWM_CPDRUPD = period; // Period in half uS - if (period != 5000) { // 2.5 mS + if (period != 2500 * 2) { setupPulses(EXTERNAL_MODULE); } else { @@ -260,14 +260,14 @@ extern "C" void PWM_IRQHandler(void) case PROTO_DSM2_DSMX: // Alternate periods of 19.5mS and 2.5 mS period = pwmptr->PWM_CH_NUM[3].PWM_CPDR; - if (period == 5000) { // 2.5 mS + if (period == 2500 * 2) { period = 19500 * 2; } else { - period = 5000; + period = 2500 * 2; } pwmptr->PWM_CH_NUM[3].PWM_CPDRUPD = period; // Period in half uS - if (period != 5000) { // 2.5 mS + if (period != 2500 * 2) { setupPulses(EXTERNAL_MODULE); } else {