Closed algernon closed 1 year ago
Build artifacts for this pull request are available!
The build artifacts are provided as-is, for testing and reviewing purposes. They contain code that has not been reviewed or audited by Chrysalis' developers. They are not endorsed by Keyboardio, they are not signed. Install and use them only if you know what you are doing.
Rebooting to Application mode is retryable, we should not be throwing an uncrecoverable exception if it fails, as that will abort the flashing process needlessly.
To make it retryable, this patch changes
runDFUUtil
to throw an exception with either aHARD_FAIL
or aSOFT_FAIL
message. Flashing will then stop in either case, because we do not retry flashing. ButrebootToApplicationMode
can catch the exception, and ignore it, because the main flashing loop will double check that the keyboard did end up in app mode.Additionally, when doing flashing, lets not run
dfu-util
with--reset
, because we'll do that reset explicitly inrebootToApplicationMode()
. In turn, do not use--reset
there, either, because--detach
is enough,--reset
just gives us an extra warning and doesn't do anything.However, if we're starting from bootloader mode, with
--reset
removed from the flash call, we need to do an explicitrebootToApplicationMode()
before returning. Lets do that, too.Fixes #1221.