-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Powman fix #2499
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
base: develop
Are you sure you want to change the base?
Powman fix #2499
Conversation
You can also use gpios 13 and 15 on RP2350
LGTM 👍 |
@@ -102,7 +102,15 @@ static void powman_timer_use_gpio(uint32_t gpio, uint32_t use, uint32_t using) { | |||
if (was_running) powman_timer_stop(); | |||
invalid_params_if(HARDWARE_POWMAN, !((gpio == 12) || (gpio == 14) || (gpio == 20) || (gpio == 22))); |
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 i'd like to introduce a POWMAN_GPIO_SOURCE(gpio) macro guarded by an #Ifdef in the header, which contains the invalid_params_if and the source switch. This is just a bit more future proof
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.
Reminds me a bit of https://github.com/raspberrypi/pico-sdk/blob/develop/src/rp2_common/hardware_adc/include/hardware/adc.h#L96 and the ADC_PIN_TO_CHANNEL
that was suggested in #1513 😉
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.
Why a macro and not an inline function? Why would it need to be guarded by an #Ifdef ?
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.
@kilograham Sorry, I think you're going to have to do this as I can't guess what you want and am likely to get it wrong.
powman_timer_use_gpio is wrong.
And fix the docs for clock_gpio_init etc - spotted while testing powman_timer_use_gpio