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.
This commit is contained in:
Michael Jakob 2014-12-15 07:46:47 +01:00
parent f5a579de14
commit 4b0d5e7e15
3 changed files with 4 additions and 1 deletions

View File

@ -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];

View File

@ -38,6 +38,7 @@
typedef struct drv_pwm_config_t {
bool useParallelPWM;
bool usePPM;
bool useSerialRx;
bool useRSSIADC;
bool useCurrentMeterADC;
#ifdef STM32F10X

View File

@ -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;