-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Adding flexio pwm support for MCXW71 and MCXW72 devices. #92325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding flexio pwm support for MCXW71 and MCXW72 devices. #92325
Conversation
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
c01b24e
to
ab33dcc
Compare
ab33dcc
to
5a2c34b
Compare
9c56472
to
e8d7c82
Compare
@EmilioCBen please fix the merge conflict. |
e8d7c82
to
1d46661
Compare
1d46661
to
353cb3f
Compare
drivers/pwm/pwm_nxp_flexio.c
Outdated
is_only_low_or_high = true; | ||
} else if (duty_cycle == period_cycles && !pulse_cycles) { | ||
polarity = FLEXIO_PWM_ACTIVE_HIGH; | ||
is_only_low_or_high = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EmilioCBen the SonarCube is flagging this because it wants an empty "else" here for defensive programming reasons. So end this with:
} else {
/* Some reasonable comment on why there isn't anything in the else block */
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the code, just hoping an empty else case doesn't get flagged.
3768a7e
to
5bdc35b
Compare
drivers/pwm/pwm_nxp_flexio.c
Outdated
if (period_cycles == pulse_cycles) { | ||
polarity = FLEXIO_PWM_ACTIVE_LOW; | ||
is_only_low_or_high = true; | ||
} else if (duty_cycle == period_cycles && !pulse_cycles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!pulse_cycles
should be pulse_cycles == 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
5bdc35b
to
57c6836
Compare
Updated the nxp flexio pwm driver to account for when the duty cycle is 100% or 0%. We switch off the counter of the flexio and manually set the GPIO High or Low. Otherwise Flexio Peripheral with default to a 50% duty cycle behavior. Factored out timerOutput variable. Signed-off-by: Emilio Benavente <[email protected]>
Updated the nxp_mcxw7x dts to include a flexio_pwm node. Signed-off-by: Emilio Benavente <[email protected]>
Enabled testing for the flexio pwm on MCXW7X Platforms. Signed-off-by: Emilio Benavente <[email protected]>
57c6836
to
0f62dc5
Compare
|
Adding flexio pwm support for MCXW71 and MCXW72 devices.