drivers: pwm: stm32: fix polarity setting
PWM polarity was not being set correctly because flags were not checked correctly. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
parent
68d0042138
commit
2ece951c1b
1 changed files with 1 additions and 1 deletions
|
@ -94,7 +94,7 @@ static inline const struct pwm_stm32_config *to_config(struct device *dev)
|
|||
*/
|
||||
static uint32_t get_polarity(pwm_flags_t flags)
|
||||
{
|
||||
if (flags & PWM_POLARITY_NORMAL) {
|
||||
if ((flags & PWM_POLARITY_MASK) == PWM_POLARITY_NORMAL) {
|
||||
return LL_TIM_OCPOLARITY_HIGH;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue