mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 20:11:00 +00:00
bootloader: stop/deinit usb for unplug events as well
This commit is contained in:
parent
b922579173
commit
9e31e0f4d4
@ -202,9 +202,13 @@ bool bootloader_loop(void)
|
|||||||
r = process_msg_WipeDevice(USB_IFACE_NUM, msg_size, buf);
|
r = process_msg_WipeDevice(USB_IFACE_NUM, msg_size, buf);
|
||||||
if (r < 0) { // error
|
if (r < 0) { // error
|
||||||
display_error();
|
display_error();
|
||||||
|
usb_stop();
|
||||||
|
usb_deinit();
|
||||||
return false; // shutdown
|
return false; // shutdown
|
||||||
} else { // success
|
} else { // success
|
||||||
display_done(0);
|
display_done(0);
|
||||||
|
usb_stop();
|
||||||
|
usb_deinit();
|
||||||
return false; // shutdown
|
return false; // shutdown
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -220,6 +224,8 @@ bool bootloader_loop(void)
|
|||||||
r = process_msg_FirmwareUpload(USB_IFACE_NUM, msg_size, buf);
|
r = process_msg_FirmwareUpload(USB_IFACE_NUM, msg_size, buf);
|
||||||
if (r < 0) { // error
|
if (r < 0) { // error
|
||||||
display_error();
|
display_error();
|
||||||
|
usb_stop();
|
||||||
|
usb_deinit();
|
||||||
return false; // shutdown
|
return false; // shutdown
|
||||||
} else
|
} else
|
||||||
if (r == 0) { // last chunk received
|
if (r == 0) { // last chunk received
|
||||||
|
Loading…
Reference in New Issue
Block a user