press reset to safe mode on ports where reset reason is not implemented #4306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for #4292
This will let
wait_for_safe_mode_reset
run if the reset reason isRESET_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.