-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Implement BOOTSEL button entry to safe mode for RP2. #10231
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor looks good! One other question before approving.
ports/raspberrypi/supervisor/port.c
Outdated
@@ -576,3 +583,53 @@ void port_boot_info(void) { | |||
mp_printf(&mp_plat_print, "\n"); | |||
#endif | |||
} | |||
|
|||
#if defined(CIRCUITPY_BOOT_BUTTON_NO_GPIO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you only want this if there is no separate BOOT button?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it and agree that that is the correct policy. Will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question. Thanks for the update!
… defined. Co-authored-by: Scott Shawcroft <scott@tannewt.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Implements BOOTSEL button entry to safe mode the RP2 port.
Resolves issue #9710.