Skip to content

powman_timer_use_gpio writing wrong value to ext_time_ref register? #2471

Open
@czietz

Description

@czietz

I wonder how this can be right:

static void powman_timer_use_gpio(uint32_t gpio, uint32_t use, uint32_t using) {
bool was_running = powman_timer_is_running();
if (was_running) powman_timer_stop();
invalid_params_if(HARDWARE_POWMAN, !((gpio == 12) || (gpio == 14) || (gpio == 20) || (gpio == 22)));
gpio_set_input_enabled(gpio, true);
powman_write(&powman_hw->ext_time_ref, gpio);
powman_set_bits(&powman_hw->timer, use);
if (was_running) {
powman_timer_start();
while(!(powman_hw->timer & using));
}
}

According to the RP2350 datasheet:

Image

... ext_time_ref does not directly take the GPIO number (12, 20, 14, 22), but is an enum (0 ... 3). However, the function above writes the GPIO number directly into the register.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions