Skip to content

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

peterharperuk
Copy link
Contributor

powman_timer_use_gpio is wrong.
And fix the docs for clock_gpio_init etc - spotted while testing powman_timer_use_gpio

@peterharperuk peterharperuk requested a review from kilograham June 2, 2025 12:21
@lurch lurch linked an issue Jun 2, 2025 that may be closed by this pull request
You can also use gpios 13 and 15 on RP2350
@lurch
Copy link
Contributor

lurch commented Jun 5, 2025

LGTM 👍

@kilograham kilograham added this to the 2.1.2 milestone Jun 12, 2025
@@ -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)));
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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 ?

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

powman_timer_use_gpio writing wrong value to ext_time_ref register?
3 participants