Implement BOOTSEL button entry to safe mode for RP2.#10231
Conversation
tannewt
left a comment
There was a problem hiding this comment.
Looks fine to me but the CI is unhappy.
…BOOTSEL GPIO connection.
|
Fixed up CI by adding an additional Noticed an opportunity for a bit of code refactoring and took it. |
tannewt
left a comment
There was a problem hiding this comment.
Refactor looks good! One other question before approving.
| #endif | ||
| } | ||
|
|
||
| #if defined(CIRCUITPY_BOOT_BUTTON_NO_GPIO) |
There was a problem hiding this comment.
Do you only want this if there is no separate BOOT button?
There was a problem hiding this comment.
It's there for some flexibility that we may not need. For example, an individual board could undefine CIRCUITPY_BOOT_BUTTON_NO_GPIO and define a GPIO pin with CIRCUITPY_BOOT_BUTTON.
There was a problem hiding this comment.
I'd assume that CIRCUITPY_BOOT_BUTTON would take precedence.
Note we generally don't use defined/undefined for CP macros. Instead we always test their value and have a default value #ifndef in py/. This ensures the code that uses it includes the correct headers.
There was a problem hiding this comment.
Got it and agree that that is the correct policy. Will update.
There was a problem hiding this comment.
Made CIRCUITPY_BOOT_BUTTON_NO_GPIO default to 0, changed usage to #if from #ifdef. Added compile-time check prohibiting CIRCUITPY_BOOT_BUTTON and CIRCUITPY_BOOT_BUTTON_NO_GPIO.
…le time check forbidding CIRCUITPY_BOOT_BUTTON and CIRCUITPY_BOOT_BUTTON_NO_GPIO.
tannewt
left a comment
There was a problem hiding this comment.
One question. Thanks for the update!
… defined. Co-authored-by: Scott Shawcroft <scott@tannewt.org>
Implements BOOTSEL button entry to safe mode the RP2 port.
Resolves issue #9710.