-
Notifications
You must be signed in to change notification settings - Fork 90
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
fix(PeriphDrivers): Zephyr build issue #1234
Conversation
Why are we re-including these unsupported definitions? The ME30 only supports high-impedance, weak pull-up, and weak pull-down. Because it's a new part, I removed |
Good question. |
MXC_GPIO_PAD_PULL_UP, ///< Set pad to weak pull-up | ||
MXC_GPIO_PAD_PULL_DOWN, ///< Set pad to weak pull-down | ||
MXC_GPIO_PAD_WEAK_PULL_UP = MXC_GPIO_PAD_PULL_UP, ///< Set pad to weak pull-up | ||
MXC_GPIO_PAD_WEAK_PULL_DOWN = MXC_GPIO_PAD_PULL_DOWN, ///< Set pad to weak pull-down |
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.
I think this is a little more readable:
MXC_GPIO_PAD_WEAK_PULL_UP, ///< Set pad to weak pull-up
MXC_GPIO_PAD_WEAK_PULL_DOWN, ///< Set pad to weak pull-down
MXC_GPIO_PAD_PULL_UP = MXC_GPIO_PAD_WEAK_PULL_UP, ///< Set pad to default (weak) pull-up
MXC_GPIO_PAD_PULL_DOWN = MXC_GPIO_PAD_WEAK_PULL_DOWN, ///< Set pad to default (weak) pull-down
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.
Correct, make sense.
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.
My 2 cents:
-
It only matters to make the distinction between weak/strong if the micro actually supports both. Otherwise, the only distinction to make is up or down.
MXC_GPIO_PAD_PULL_UP
andMXC_GPIO_PAD_PULL_DOWN
should be used since the names are generic and the code is readable. -
Removing enums just for MAX32657 gpio.h will demand extra
#ifdef
s. I would favor consolidation instead of divergence and leave these defined.
With this in mind I support re-defining the enums.
With them re-added, MXC_GPIO_Config
will return E_BAD_PARAM
if the user requests MXC_GPIO_PAD_PULL_UP
. I would suggest mapping the enums onto each other like I did for the AI87 here and avoid the confusing error condition.
Zephyr drivers requires pullup and pulldown definition. This commit fix build issue on zephyr side Signed-off-by: Sadik Ozer <[email protected]>
ed59317
to
3f90f66
Compare
…1234) Signed-off-by: Sadik Ozer <[email protected]>
Description
Zephyr drivers requires pullup and pulldown definition. This commit fix build issue on zephyr side
Checklist Before Requesting Review