From 7883f0e6a47deed86af871bedef074ba449889d7 Mon Sep 17 00:00:00 2001 From: Mateusz Szafoni Date: Sun, 24 Mar 2019 08:07:59 -0600 Subject: [PATCH] arch/arm/src/stm32/stm32_pwm.c: Set CCPxP and CCPxNP bits if polarity is negative. --- arch/arm/src/stm32/stm32_pwm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 5fd38b14a62..4a2512e9f67 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -2874,7 +2874,7 @@ static int pwm_output_configure(FAR struct stm32_pwmtimer_s *priv, /* Configure output polarity (all PWM timers) */ - if (priv->channels[channel-1].out1.pol == STM32_POL_POS) + if (priv->channels[channel-1].out1.pol == STM32_POL_NEG) { ccer |= (GTIM_CCER_CC1P << ((channel-1)*4)); } @@ -2912,7 +2912,7 @@ static int pwm_output_configure(FAR struct stm32_pwmtimer_s *priv, /* Configure complementary output polarity */ - if (priv->channels[channel-1].out2.pol == STM32_POL_POS) + if (priv->channels[channel-1].out2.pol == STM32_POL_NEG) { ccer |= (ATIM_CCER_CC1NP << ((channel-1)*4)); }