You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/src/apps/management/reboot_to_bootloader.py

18 lines
463 B

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