1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-06-30 20:02:34 +00:00
trezor-firmware/core/src/apps/management/reboot_to_bootloader.py

18 lines
463 B
Python

from typing import TYPE_CHECKING
from trezor import utils, wire
from trezor.messages import RebootToBootloader, Success
if TYPE_CHECKING:
from typing import NoReturn
pass
async def reboot_to_bootloader(ctx: wire.Context, msg: RebootToBootloader) -> NoReturn:
await ctx.write(Success())
# writing synchronously twice makes USB flush properly before reboot
await ctx.write(Success())
utils.reboot_to_bootloader()
raise RuntimeError