Skip to content
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

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

Merged
merged 2 commits into from
Mar 2, 2021

Conversation

Neradoc
Copy link

@Neradoc Neradoc commented Mar 2, 2021

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
Copy link
Member

tannewt commented Mar 2, 2021

This change looks good! Unfortunately, it looks like including the safe mode wait overflowed a few builds. @dhalbert how hard would it be for us to switch to the -Os libgcc?

@dhalbert
Copy link
Collaborator

dhalbert commented Mar 2, 2021

@dhalbert how hard would it be for us to switch to the -Os libgcc?

I will look into that, and also see if a simple CFLAGS_INLINE_LIMIT change would immediately work.

Copy link
Collaborator

@dhalbert dhalbert left a comment

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