From 56167eb0d2a80020fa7c47f7c09a6ded87ebaefd Mon Sep 17 00:00:00 2001 From: Rimas Avizienis Date: Wed, 25 Mar 2015 12:35:02 -0700 Subject: [PATCH] workaround for AUX1-4 PWM signals missing on PWM5-8 outputs when LED_STRIP is enabled on NAZE32 --- src/main/drivers/pwm_mapping.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/drivers/pwm_mapping.c b/src/main/drivers/pwm_mapping.c index 760aec33c..a3d53deb4 100644 --- a/src/main/drivers/pwm_mapping.c +++ b/src/main/drivers/pwm_mapping.c @@ -455,9 +455,17 @@ pwmOutputConfiguration_t *pwmInit(drv_pwm_config_t *init) } if (init->extraServos && !init->airplane) { - // remap PWM5..8 as servos when used in extended servo mode - if (timerIndex >= PWM5 && timerIndex <= PWM8) - type = MAP_TO_SERVO_OUTPUT; +#if defined(NAZE) && defined(LED_STRIP_TIMER) + // if LED strip is active, PWM5-8 are unavailable, so map AUX1+AUX2 to PWM13+PWM14 + if (init->useLEDStrip) { + if (timerIndex >= PWM13 && timerIndex <= PWM14) { + type = MAP_TO_SERVO_OUTPUT; + } + } else +#endif + // remap PWM5..8 as servos when used in extended servo mode + if (timerIndex >= PWM5 && timerIndex <= PWM8) + type = MAP_TO_SERVO_OUTPUT; } #endif