Skip to content

pio_sm_set_jmp_pin() missing #1325

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

Closed
arg08 opened this issue Mar 26, 2023 · 3 comments
Closed

pio_sm_set_jmp_pin() missing #1325

arg08 opened this issue Mar 26, 2023 · 3 comments

Comments

@arg08
Copy link
Contributor

arg08 commented Mar 26, 2023

All of the other PIO configuration features are duplicated between the sm_config_xxx() functions for efficient bulk initialisation and the pio_sm_set_xxx() functions for dynamically tweaking the config. For example, there's sm_config_set_in_pins() and pio_sm_set_in_pins().

However, pio_sm_set_jmp_pin() is missing (to complement sm_config_set_jmp_pin() which does exist).

I use the following in my code:

static inline void pio_sm_set_jmp_pin(PIO pio, uint sm, uint pin)
{
    check_pio_param(pio);
    check_sm_param(sm);
    valid_params_if(PIO, pin < 32);

    pio->sm[sm].execctrl =
        (pio->sm[sm].execctrl & ~PIO_SM0_EXECCTRL_JMP_PIN_BITS)
        | (pin << PIO_SM0_EXECCTRL_JMP_PIN_LSB);
}

written in the style of src/rp2_common/hardware_pio/include/hardware/pio.h where it really belongs.

@kilograham kilograham added this to the 1.6.0 milestone May 26, 2023
@kilograham kilograham modified the milestones: 1.6.0, 1.5.2 Jun 14, 2023
@kilograham kilograham modified the milestones: 1.6.0, 1.6.1, 1.6.2 Jul 7, 2024
@kilograham kilograham modified the milestones: 1.6.2, 2.0.0 Aug 8, 2024
@peterharperuk
Copy link
Contributor

This has been added

@pucgenie
Copy link

pucgenie commented Sep 12, 2024

There's code for this procedure in usb_rx.pio.h conflicting with the pio.h one. (Just freshly downloaded and installed the pico_sdk today (on Ubuntu 24.04) as a dependency of GP2040-CE. Can't find the version - grep told me "picotool version 2.0.0")
Deleting the one in usb_rx.pio.h fixed it for me - but how could this happen?

EDIT: Sorry, wrong project - bug seems to be inside sekigon-gonnoc/Pico-PIO-USB

@lurch
Copy link
Contributor

lurch commented Sep 13, 2024

EDIT: Sorry, wrong project - bug seems to be inside sekigon-gonnoc/Pico-PIO-USB

Yes, see #1849

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

No branches or pull requests

5 participants