Skip to content

Update on_next_reset for new safe mode. #1869

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

Merged
merged 2 commits into from
May 10, 2019

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented May 8, 2019

Fixes #1831

@tannewt tannewt added this to the 4.0.0 - Bluetooth milestone May 8, 2019
@tannewt tannewt requested a review from dhalbert May 8, 2019 22:25
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.

Tested on Hallowing. Works as expected when doing microcontroller.reset().

Q: Is it also supposed to work when pressing the reset button? It does not work for me when doing that.

If not, then would it make sense to eliminate on_next_reset() and just add an optional argument to microcontroller.reset() ?

Will re-review after answer.

@tannewt
Copy link
Member Author

tannewt commented May 9, 2019

Will have to pick this up tomorrow. Looks like it should work with the button for CircuitPlayground single click into bootloader: #350 (comment)

@dhalbert
Copy link
Collaborator

dhalbert commented May 9, 2019

Neither the BOOTLOADER nor SAFE_MODE worked when pressing the reset button once. Maybe the value is getting overwritten by the bootloader, since now it's a regular static: static mcu_runmode_t next_reset; instead of using _ezero ?

@tannewt
Copy link
Member Author

tannewt commented May 9, 2019

@dhalbert I didn't expect it to work but I do now. :-) I swapped it back to setting values in on_next_reset.

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.

Tested with M0 and M4 boards with pushbutton and microcontroller.reset() resets. Works great!

@dhalbert dhalbert merged commit dae8b21 into adafruit:master May 10, 2019
@dhalbert
Copy link
Collaborator

Tested this further on Feather nRF52840 and it doesn't change the mode when reset either by hand or programmatically.

@dhalbert
Copy link
Collaborator

Ah, OK, I see issue #1868 for nrf support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failer to boot into Safe Mode
2 participants