mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 03:18:09 +00:00
core: initialize fatfs only after we know the SD card is powered
This commit is contained in:
parent
7394ecfa77
commit
6c14ee7ec0
@ -116,11 +116,12 @@ async def set_sd_salt(
|
|||||||
salt_path = "%s/%s" % (device_dir, filename)
|
salt_path = "%s/%s" % (device_dir, filename)
|
||||||
|
|
||||||
sd = io.SDCard()
|
sd = io.SDCard()
|
||||||
fs = io.FatFS()
|
|
||||||
if not sd.power(True):
|
if not sd.power(True):
|
||||||
await insert_card_dialog(ctx)
|
await insert_card_dialog(ctx)
|
||||||
raise SdProtectCancelled
|
raise SdProtectCancelled
|
||||||
|
|
||||||
|
fs = io.FatFS()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fs.mount()
|
fs.mount()
|
||||||
fs.mkdir("/trezor", True)
|
fs.mkdir("/trezor", True)
|
||||||
|
@ -75,8 +75,8 @@ async def lockscreen() -> None:
|
|||||||
if utils.EMULATOR:
|
if utils.EMULATOR:
|
||||||
# Ensure the emulated SD card is FAT32 formatted.
|
# Ensure the emulated SD card is FAT32 formatted.
|
||||||
sd = io.SDCard()
|
sd = io.SDCard()
|
||||||
fs = io.FatFS()
|
|
||||||
sd.power(True)
|
sd.power(True)
|
||||||
|
fs = io.FatFS()
|
||||||
try:
|
try:
|
||||||
fs.mount()
|
fs.mount()
|
||||||
except OSError:
|
except OSError:
|
||||||
|
Loading…
Reference in New Issue
Block a user