press reset to safe mode on ports where reset reason is not implemented by Neradoc · Pull Request #4306 · adafruit/circuitpython · GitHub
Skip to content

press reset to safe mode on ports where reset reason is not implemented#4306

Merged
dhalbert merged 2 commits into
adafruit:mainfrom
Neradoc:fix-reset-to-safe
Mar 2, 2021
Merged

press reset to safe mode on ports where reset reason is not implemented#4306
dhalbert merged 2 commits into
adafruit:mainfrom
Neradoc:fix-reset-to-safe

Conversation

@Neradoc

@Neradoc Neradoc commented Mar 2, 2021

Copy link
Copy Markdown

Fix for #4292
This will let wait_for_safe_mode_reset run if the reset reason is RESET_REASON_UNKNOWN to account for ports that don't implement it fully.

However it might not make sense when the reset reason is implemented though, since we only want to do that when powering on or pressing reset. So a better fix might be to use a #define (in each port's Processor.c/h) to remove the test altogether when not fully implemented (that might even save a few bytes on those ports).

Ultimately the fix is to fully implement common_hal_mcu_processor_get_reset_reason for each port, but I'll leave that as an exercise to the reader.

@tannewt

tannewt commented Mar 2, 2021

Copy link
Copy Markdown
Member

@dhalbert

dhalbert commented Mar 2, 2021

Copy link
Copy Markdown
Collaborator

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I cleaned up some more mpconfigport.mk files that I had missed before, and fixed the overflows.

@dhalbert dhalbert merged commit 0a58d45 into adafruit:main Mar 2, 2021
@Neradoc Neradoc deleted the fix-reset-to-safe branch March 12, 2021 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants