Skip to content

Conversation

@kilograham
Copy link
Contributor

  • fix bug: pioasm was spilling bit 5 of arg2 into arg1
  • make pio_add_program flip bit 5 of a WAIT GPIO instruction if gpio_base is 16

Note: pioasm will encode only the bits 4-0 of arg2 (the GPIO number), however it does indicate whether 0-15 means 0-15 or 32-47. This can only be fixed up when loading the program, and indeed once the GPIO base is known. pio_can_add_program and friends already detected the cases where this was impossible

@kilograham kilograham added this to the 2.1.1 milestone Feb 14, 2025
@kilograham
Copy link
Contributor Author

fixes #2141

@kilograham kilograham changed the title Fix for n > 32 and when using gpio_base = 16 Fix WAIT GPIO n for n > 32 and when using gpio_base = 16 Feb 14, 2025
- fix bug: pioasm was spilling bit 5 of arg2 into arg1
- make pio_add_program flip bit 5 of a WAIT GPIO instruction if gpio_base is 16

Note: pioasm will encode only the bits 4-0 of arg2 (the GPIO number), however it does indicate whether
0-15 means 0-15 or 32-47. This can only be fixed up when loading the program, and indeed once the GPIO
base is known. pio_can_add_program and friends already detected the cases where this was impossible
Copy link
Contributor

@peterharperuk peterharperuk left a comment

Choose a reason for hiding this comment

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

Ok. After staring at this for awhile it looks good. We really should have an example of using this. Any suggestions?

@kilograham kilograham merged commit 302fd9a into develop Feb 14, 2025
8 checks passed
@kilograham kilograham deleted the pio_wait_jmp_hi_pins branch February 14, 2025 15:26
will-v-pi pushed a commit to will-v-pi/pico-sdk that referenced this pull request Mar 20, 2025
…pi#2265)

- fix bug: pioasm was spilling bit 5 of arg2 into arg1
- make pio_add_program flip bit 5 of a WAIT GPIO instruction if gpio_base is 16

Note: pioasm will encode only the bits 4-0 of arg2 (the GPIO number), however it does indicate whether
0-15 means 0-15 or 32-47. This can only be fixed up when loading the program, and indeed once the GPIO
base is known. pio_can_add_program and friends already detected the cases where this was impossible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants