Assert ordering of pins in bi_pins_with_names is correct #1791

Closed
will-v-pi wants to merge 1 commit from bi-pins-order-assert into develop
will-v-pi commented 2024-08-09 09:31:04 -05:00 (Migrated from github.com)

Fixes #878 by adding an assertion that the ordering of pins in bi_pins_with_names is correct

The pins are passed as a pin mask, so there is no ordering, and therefore the pins must be given in ascending order else the names will be associated with the wrong pins

This breaks compilation of the pio/spi/spi_flash example, as the pins there are not in order - given the default pins could be in any order depending on the board, that example should probably be modified to have 4 separate bi_1pin_with_name lines instead of a single bi_4pins_with_names

Fixes #878 by adding an assertion that the ordering of pins in bi_pins_with_names is correct The pins are passed as a pin mask, so there is no ordering, and therefore the pins must be given in ascending order else the names will be associated with the wrong pins This breaks compilation of the pio/spi/spi_flash example, as the pins there are not in order - given the default pins could be in any order depending on the board, that example should probably be modified to have 4 separate `bi_1pin_with_name` lines instead of a single `bi_4pins_with_names`
lurch commented 2024-08-21 06:20:19 -05:00 (Migrated from github.com)

Huhhh. Rather than break the "external API", I guess a better approach might be to reorder the names so that they're in the same order as the pins? Put perhaps the usage of macros instead of functions means that you can't do that? 🤔

Huhhh. Rather than break the "external API", I guess a better approach might be to reorder the names so that they're in the same order as the pins? Put perhaps the usage of macros instead of functions means that you can't do that? :thinking:
will-v-pi commented 2024-08-21 06:37:17 -05:00 (Migrated from github.com)

Oh yeah, that's a nicer idea - I think that's possible with macros, so I'll try that

Oh yeah, that's a nicer idea - I think that's possible with macros, so I'll try that
will-v-pi commented 2024-08-22 12:30:52 -05:00 (Migrated from github.com)

#1858 used instead

#1858 used instead

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!1791
No description provided.