Skip to content

Commit a75f984

Browse files
committed
usb: reboot to bootloader on Abort
If there is a bug in our USB processing, the unlock flow could Abort there, which would brick a device. We set auto_enter to true so that upon reconnect, we load the bootloader so there is a chance to upgrade the firmware.
1 parent 5e708ad commit a75f984

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/usb/usb_processing.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ void usb_processing_init(void)
421421
void usb_processing_lock(struct usb_processing* ctx)
422422
{
423423
if (_usb_state.blocking_ctx) {
424-
Abort("Tried to lock the USB stack while locked.");
424+
AbortAutoenter("Tried to lock the USB stack while locked.");
425425
}
426426
_usb_state.blocking_ctx = ctx;
427427
}
@@ -434,7 +434,7 @@ void usb_processing_timeout_reset(void)
434434
void usb_processing_unlock(void)
435435
{
436436
if (!_usb_state.blocking_ctx) {
437-
Abort("Tried to unlock the USB stack while not locked.");
437+
AbortAutoenter("Tried to unlock the USB stack while not locked.");
438438
}
439439
_usb_state.blocking_ctx = NULL;
440440
}

0 commit comments

Comments
 (0)