mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
arch/arm/src/stm32/stm32_pwm.c: Set CCPxP and CCPxNP bits if polarity is negative.
This commit is contained in:
committed by
Gregory Nutt
parent
324d51eaae
commit
7883f0e6a4
@@ -2874,7 +2874,7 @@ static int pwm_output_configure(FAR struct stm32_pwmtimer_s *priv,
|
|||||||
|
|
||||||
/* Configure output polarity (all PWM timers) */
|
/* 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));
|
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 */
|
/* 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));
|
ccer |= (ATIM_CCER_CC1NP << ((channel-1)*4));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user