mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-03 08:46:05 +00:00
core/modtrezorio: enable FatFS.mkfs only in emulator
This commit is contained in:
parent
d40b7c0385
commit
49a98a5015
@ -44,7 +44,11 @@
|
||||
/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */
|
||||
|
||||
|
||||
#ifdef TREZOR_EMULATOR
|
||||
#define FF_USE_MKFS 1
|
||||
#else
|
||||
#define FF_USE_MKFS 0
|
||||
#endif
|
||||
/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
|
||||
|
||||
|
||||
|
@ -460,6 +460,8 @@ STATIC mp_obj_t mod_trezorio_FatFS_unmount(mp_obj_t self) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_trezorio_FatFS_unmount_obj, mod_trezorio_FatFS_unmount);
|
||||
|
||||
#ifdef TREZOR_EMULATOR
|
||||
|
||||
/// def mkfs(self) -> None:
|
||||
/// """
|
||||
/// Create a FAT volume
|
||||
@ -475,6 +477,8 @@ STATIC mp_obj_t mod_trezorio_FatFS_mkfs(mp_obj_t self) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_trezorio_FatFS_mkfs_obj, mod_trezorio_FatFS_mkfs);
|
||||
|
||||
#endif
|
||||
|
||||
STATIC const mp_rom_map_elem_t mod_trezorio_FatFS_locals_dict_table[] = {
|
||||
{MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mod_trezorio_FatFS_open_obj)},
|
||||
{MP_ROM_QSTR(MP_QSTR_listdir), MP_ROM_PTR(&mod_trezorio_FatFS_listdir_obj)},
|
||||
@ -484,7 +488,9 @@ STATIC const mp_rom_map_elem_t mod_trezorio_FatFS_locals_dict_table[] = {
|
||||
{MP_ROM_QSTR(MP_QSTR_stat), MP_ROM_PTR(&mod_trezorio_FatFS_stat_obj)},
|
||||
{MP_ROM_QSTR(MP_QSTR_mount), MP_ROM_PTR(&mod_trezorio_FatFS_mount_obj)},
|
||||
{MP_ROM_QSTR(MP_QSTR_unmount), MP_ROM_PTR(&mod_trezorio_FatFS_unmount_obj)},
|
||||
#ifdef TREZOR_EMULATOR
|
||||
{MP_ROM_QSTR(MP_QSTR_mkfs), MP_ROM_PTR(&mod_trezorio_FatFS_mkfs_obj)},
|
||||
#endif
|
||||
};
|
||||
STATIC MP_DEFINE_CONST_DICT(mod_trezorio_FatFS_locals_dict, mod_trezorio_FatFS_locals_dict_table);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user