From 4b0d5e7e154c0a7415a116923234dfe65d130b73 Mon Sep 17 00:00:00 2001 From: Michael Jakob Date: Mon, 15 Dec 2014 07:46:47 +0100 Subject: [PATCH 1/2] Use same PWM mapping for PPM and Serial RX Without this fix an Octocopter with serialh RX will not work. Standard receiver mapping with only 6 motors outputs will apply. --- src/main/drivers/pwm_mapping.c | 3 ++- src/main/drivers/pwm_mapping.h | 1 + src/main/main.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/drivers/pwm_mapping.c b/src/main/drivers/pwm_mapping.c index b7fa0a5cf..1a93dfd1f 100644 --- a/src/main/drivers/pwm_mapping.c +++ b/src/main/drivers/pwm_mapping.c @@ -28,6 +28,7 @@ #include "pwm_output.h" #include "pwm_rx.h" #include "pwm_mapping.h" +#include "config/config.h" /* Configuration maps @@ -257,7 +258,7 @@ pwmOutputConfiguration_t *pwmInit(drv_pwm_config_t *init) // this is pretty hacky shit, but it will do for now. array of 4 config maps, [ multiPWM multiPPM airPWM airPPM ] if (init->airplane) i = 2; // switch to air hardware config - if (init->usePPM) + if (init->usePPM || init->useSerialRx) i++; // next index is for PPM setup = hardwareMaps[i]; diff --git a/src/main/drivers/pwm_mapping.h b/src/main/drivers/pwm_mapping.h index ff3b186cb..73246db29 100644 --- a/src/main/drivers/pwm_mapping.h +++ b/src/main/drivers/pwm_mapping.h @@ -38,6 +38,7 @@ typedef struct drv_pwm_config_t { bool useParallelPWM; bool usePPM; + bool useSerialRx; bool useRSSIADC; bool useCurrentMeterADC; #ifdef STM32F10X diff --git a/src/main/main.c b/src/main/main.c index e77d5b304..3c776d7bb 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -269,6 +269,7 @@ void init(void) pwm_params.useCurrentMeterADC = feature(FEATURE_CURRENT_METER); pwm_params.useLEDStrip = feature(FEATURE_LED_STRIP); pwm_params.usePPM = feature(FEATURE_RX_PPM); + pwm_params.useSerialRx = feature(FEATURE_RX_SERIAL); pwm_params.useServos = isMixerUsingServos(); pwm_params.extraServos = currentProfile->gimbalConfig.gimbal_flags & GIMBAL_FORWARDAUX; pwm_params.motorPwmRate = masterConfig.motor_pwm_rate; From 64c5cda1f7b6d78504830cf8617fc18e6218acc9 Mon Sep 17 00:00:00 2001 From: Michael Jakob Date: Mon, 15 Dec 2014 11:00:04 +0100 Subject: [PATCH 2/2] Remove include from pwm_mapping.c (not needed) --- src/main/drivers/pwm_mapping.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/drivers/pwm_mapping.c b/src/main/drivers/pwm_mapping.c index 1a93dfd1f..bdc2b3d70 100644 --- a/src/main/drivers/pwm_mapping.c +++ b/src/main/drivers/pwm_mapping.c @@ -28,7 +28,6 @@ #include "pwm_output.h" #include "pwm_rx.h" #include "pwm_mapping.h" -#include "config/config.h" /* Configuration maps