diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-aes.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-aes.h index bf36c65080..91be3b94bb 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-aes.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-aes.h @@ -184,11 +184,11 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_AES_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_AES_decrypt_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_AES___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_ECB), MP_OBJ_NEW_SMALL_INT(ECB)}, - {MP_ROM_QSTR(MP_QSTR_CBC), MP_OBJ_NEW_SMALL_INT(CBC)}, - {MP_ROM_QSTR(MP_QSTR_CFB), MP_OBJ_NEW_SMALL_INT(CFB)}, - {MP_ROM_QSTR(MP_QSTR_OFB), MP_OBJ_NEW_SMALL_INT(OFB)}, - {MP_ROM_QSTR(MP_QSTR_CTR), MP_OBJ_NEW_SMALL_INT(CTR)}, + {MP_ROM_QSTR(MP_QSTR_ECB), MP_ROM_INT(ECB)}, + {MP_ROM_QSTR(MP_QSTR_CBC), MP_ROM_INT(CBC)}, + {MP_ROM_QSTR(MP_QSTR_CFB), MP_ROM_INT(CFB)}, + {MP_ROM_QSTR(MP_QSTR_OFB), MP_ROM_INT(OFB)}, + {MP_ROM_QSTR(MP_QSTR_CTR), MP_ROM_INT(CTR)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_AES_locals_dict, mod_trezorcrypto_AES_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake256.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake256.h index 5bf917bba8..8ec78dd18c 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake256.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake256.h @@ -100,10 +100,8 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_Blake256_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_Blake256_digest_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Blake256___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), - MP_OBJ_NEW_SMALL_INT(BLAKE256_BLOCK_LENGTH)}, - {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(BLAKE256_DIGEST_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(BLAKE256_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_INT(BLAKE256_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Blake256_locals_dict, mod_trezorcrypto_Blake256_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h index 99b030df65..707de0af32 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h @@ -149,10 +149,8 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_Blake2b_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_Blake2b_digest_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Blake2b___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), - MP_OBJ_NEW_SMALL_INT(BLAKE2B_BLOCK_LENGTH)}, - {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(BLAKE2B_DIGEST_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(BLAKE2B_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_INT(BLAKE2B_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Blake2b_locals_dict, mod_trezorcrypto_Blake2b_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h index 0f289254db..5092b44ff0 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h @@ -149,10 +149,8 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_Blake2s_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_Blake2s_digest_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Blake2s___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), - MP_OBJ_NEW_SMALL_INT(BLAKE2S_BLOCK_LENGTH)}, - {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(BLAKE2S_DIGEST_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(BLAKE2S_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_INT(BLAKE2S_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Blake2s_locals_dict, mod_trezorcrypto_Blake2s_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-groestl.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-groestl.h index 637453e285..e7651ddadd 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-groestl.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-groestl.h @@ -105,10 +105,9 @@ STATIC const mp_rom_map_elem_t MP_ROM_PTR(&mod_trezorcrypto_Groestl512_digest_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Groestl512___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), - MP_OBJ_NEW_SMALL_INT(GROESTL512_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(GROESTL512_BLOCK_LENGTH)}, {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(GROESTL512_DIGEST_LENGTH)}, + MP_ROM_INT(GROESTL512_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Groestl512_locals_dict, mod_trezorcrypto_Groestl512_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-monero.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-monero.h index 5993eed20d..2d79deea00 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-monero.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-monero.h @@ -1348,10 +1348,8 @@ STATIC const mp_rom_map_elem_t MP_ROM_PTR(&mod_trezorcrypto_monero_hasher_copy_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_monero_hasher___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), - MP_OBJ_NEW_SMALL_INT(SHA3_256_BLOCK_LENGTH)}, - {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(SHA3_256_DIGEST_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(SHA3_256_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_INT(SHA3_256_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_monero_hasher_locals_dict, mod_trezorcrypto_monero_hasher_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h index d92b4f345a..e4d4bb4812 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h @@ -149,8 +149,8 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_Pbkdf2_locals_dict_table[] = { {MP_ROM_QSTR(MP_QSTR_key), MP_ROM_PTR(&mod_trezorcrypto_Pbkdf2_key_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Pbkdf2___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_HMAC_SHA256), MP_OBJ_NEW_SMALL_INT(PRF_HMAC_SHA256)}, - {MP_ROM_QSTR(MP_QSTR_HMAC_SHA512), MP_OBJ_NEW_SMALL_INT(PRF_HMAC_SHA512)}, + {MP_ROM_QSTR(MP_QSTR_HMAC_SHA256), MP_ROM_INT(PRF_HMAC_SHA256)}, + {MP_ROM_QSTR(MP_QSTR_HMAC_SHA512), MP_ROM_INT(PRF_HMAC_SHA512)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Pbkdf2_locals_dict, mod_trezorcrypto_Pbkdf2_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h index edb56181a5..c69fc24b5e 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h @@ -102,10 +102,8 @@ STATIC const mp_rom_map_elem_t MP_ROM_PTR(&mod_trezorcrypto_Ripemd160_digest_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Ripemd160___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), - MP_OBJ_NEW_SMALL_INT(RIPEMD160_BLOCK_LENGTH)}, - {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(RIPEMD160_DIGEST_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(RIPEMD160_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_INT(RIPEMD160_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Ripemd160_locals_dict, mod_trezorcrypto_Ripemd160_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h index d0483e0837..8d5d646c1b 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h @@ -247,9 +247,8 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_secp256k1_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_multiply), MP_ROM_PTR(&mod_trezorcrypto_secp256k1_multiply_obj)}, {MP_ROM_QSTR(MP_QSTR_CANONICAL_SIG_ETHEREUM), - MP_OBJ_NEW_SMALL_INT(CANONICAL_SIG_ETHEREUM)}, - {MP_ROM_QSTR(MP_QSTR_CANONICAL_SIG_EOS), - MP_OBJ_NEW_SMALL_INT(CANONICAL_SIG_EOS)}, + MP_ROM_INT(CANONICAL_SIG_ETHEREUM)}, + {MP_ROM_QSTR(MP_QSTR_CANONICAL_SIG_EOS), MP_ROM_INT(CANONICAL_SIG_EOS)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_secp256k1_globals, mod_trezorcrypto_secp256k1_globals_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha1.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha1.h index 16808ffc7f..01f75d33b8 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha1.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha1.h @@ -100,9 +100,8 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_Sha1_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_Sha1_digest_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Sha1___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), MP_OBJ_NEW_SMALL_INT(SHA1_BLOCK_LENGTH)}, - {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(SHA1_DIGEST_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(SHA1_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_INT(SHA1_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Sha1_locals_dict, mod_trezorcrypto_Sha1_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h index 459f4a759a..2e00aaed5e 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h @@ -100,10 +100,8 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_Sha256_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_Sha256_digest_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Sha256___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), - MP_OBJ_NEW_SMALL_INT(SHA256_BLOCK_LENGTH)}, - {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(SHA256_DIGEST_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(SHA256_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_INT(SHA256_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Sha256_locals_dict, mod_trezorcrypto_Sha256_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h index 246fefd98d..d8ff0c2b2c 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h @@ -136,10 +136,8 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_Sha3_256_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_Sha3_256_copy_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Sha3_256___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), - MP_OBJ_NEW_SMALL_INT(SHA3_256_BLOCK_LENGTH)}, - {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(SHA3_256_DIGEST_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(SHA3_256_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_INT(SHA3_256_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Sha3_256_locals_dict, mod_trezorcrypto_Sha3_256_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h index cb15f8c293..24b1d318de 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h @@ -136,10 +136,8 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_Sha3_512_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_Sha3_512_copy_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Sha3_512___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), - MP_OBJ_NEW_SMALL_INT(SHA3_512_BLOCK_LENGTH)}, - {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(SHA3_512_DIGEST_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(SHA3_512_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_INT(SHA3_512_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Sha3_512_locals_dict, mod_trezorcrypto_Sha3_512_locals_dict_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h index d84d34bb51..481728cac3 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h @@ -99,10 +99,8 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_Sha512_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_Sha512_digest_obj)}, {MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mod_trezorcrypto_Sha512___del___obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), - MP_OBJ_NEW_SMALL_INT(SHA512_BLOCK_LENGTH)}, - {MP_ROM_QSTR(MP_QSTR_digest_size), - MP_OBJ_NEW_SMALL_INT(SHA512_DIGEST_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(SHA512_BLOCK_LENGTH)}, + {MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_INT(SHA512_DIGEST_LENGTH)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_Sha512_locals_dict, mod_trezorcrypto_Sha512_locals_dict_table); diff --git a/core/embed/extmod/modtrezorio/modtrezorio-sdcard.h b/core/embed/extmod/modtrezorio/modtrezorio-sdcard.h index f338d7ee7e..1e8f297295 100644 --- a/core/embed/extmod/modtrezorio/modtrezorio-sdcard.h +++ b/core/embed/extmod/modtrezorio/modtrezorio-sdcard.h @@ -119,7 +119,7 @@ STATIC const mp_rom_map_elem_t mod_trezorio_SDCard_locals_dict_table[] = { {MP_ROM_QSTR(MP_QSTR_power), MP_ROM_PTR(&mod_trezorio_SDCard_power_obj)}, {MP_ROM_QSTR(MP_QSTR_capacity), MP_ROM_PTR(&mod_trezorio_SDCard_capacity_obj)}, - {MP_ROM_QSTR(MP_QSTR_block_size), MP_OBJ_NEW_SMALL_INT(SDCARD_BLOCK_SIZE)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(SDCARD_BLOCK_SIZE)}, {MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mod_trezorio_SDCard_read_obj)}, {MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mod_trezorio_SDCard_write_obj)}, }; diff --git a/core/embed/extmod/modtrezorio/modtrezorio.c b/core/embed/extmod/modtrezorio/modtrezorio.c index 38d6967e31..8da9d03f39 100644 --- a/core/embed/extmod/modtrezorio/modtrezorio.c +++ b/core/embed/extmod/modtrezorio/modtrezorio.c @@ -59,16 +59,13 @@ STATIC const mp_rom_map_elem_t mp_module_trezorio_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_WebUSB), MP_ROM_PTR(&mod_trezorio_WebUSB_type)}, {MP_ROM_QSTR(MP_QSTR_poll), MP_ROM_PTR(&mod_trezorio_poll_obj)}, - {MP_ROM_QSTR(MP_QSTR_POLL_READ), MP_OBJ_NEW_SMALL_INT(POLL_READ)}, - {MP_ROM_QSTR(MP_QSTR_POLL_WRITE), MP_OBJ_NEW_SMALL_INT(POLL_WRITE)}, + {MP_ROM_QSTR(MP_QSTR_POLL_READ), MP_ROM_INT(POLL_READ)}, + {MP_ROM_QSTR(MP_QSTR_POLL_WRITE), MP_ROM_INT(POLL_WRITE)}, - {MP_ROM_QSTR(MP_QSTR_TOUCH), MP_OBJ_NEW_SMALL_INT(TOUCH_IFACE)}, - {MP_ROM_QSTR(MP_QSTR_TOUCH_START), - MP_OBJ_NEW_SMALL_INT((TOUCH_START >> 24) & 0xFFU)}, - {MP_ROM_QSTR(MP_QSTR_TOUCH_MOVE), - MP_OBJ_NEW_SMALL_INT((TOUCH_MOVE >> 24) & 0xFFU)}, - {MP_ROM_QSTR(MP_QSTR_TOUCH_END), - MP_OBJ_NEW_SMALL_INT((TOUCH_END >> 24) & 0xFFU)}, + {MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_INT(TOUCH_IFACE)}, + {MP_ROM_QSTR(MP_QSTR_TOUCH_START), MP_ROM_INT((TOUCH_START >> 24) & 0xFFU)}, + {MP_ROM_QSTR(MP_QSTR_TOUCH_MOVE), MP_ROM_INT((TOUCH_MOVE >> 24) & 0xFFU)}, + {MP_ROM_QSTR(MP_QSTR_TOUCH_END), MP_ROM_INT((TOUCH_END >> 24) & 0xFFU)}, }; STATIC MP_DEFINE_CONST_DICT(mp_module_trezorio_globals, diff --git a/core/embed/extmod/modtrezorui/modtrezorui-display.h b/core/embed/extmod/modtrezorui/modtrezorui-display.h index 319b1308c0..dcd95cc972 100644 --- a/core/embed/extmod/modtrezorui/modtrezorui-display.h +++ b/core/embed/extmod/modtrezorui/modtrezorui-display.h @@ -510,13 +510,13 @@ STATIC const mp_rom_map_elem_t mod_trezorui_Display_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorui_Display_backlight_obj)}, {MP_ROM_QSTR(MP_QSTR_offset), MP_ROM_PTR(&mod_trezorui_Display_offset_obj)}, {MP_ROM_QSTR(MP_QSTR_save), MP_ROM_PTR(&mod_trezorui_Display_save_obj)}, - {MP_ROM_QSTR(MP_QSTR_WIDTH), MP_OBJ_NEW_SMALL_INT(DISPLAY_RESX)}, - {MP_ROM_QSTR(MP_QSTR_HEIGHT), MP_OBJ_NEW_SMALL_INT(DISPLAY_RESY)}, - {MP_ROM_QSTR(MP_QSTR_FONT_SIZE), MP_OBJ_NEW_SMALL_INT(FONT_SIZE)}, - {MP_ROM_QSTR(MP_QSTR_FONT_NORMAL), MP_OBJ_NEW_SMALL_INT(FONT_NORMAL)}, - {MP_ROM_QSTR(MP_QSTR_FONT_BOLD), MP_OBJ_NEW_SMALL_INT(FONT_BOLD)}, - {MP_ROM_QSTR(MP_QSTR_FONT_MONO), MP_OBJ_NEW_SMALL_INT(FONT_MONO)}, - {MP_ROM_QSTR(MP_QSTR_FONT_MONO_BOLD), MP_OBJ_NEW_SMALL_INT(FONT_MONO_BOLD)}, + {MP_ROM_QSTR(MP_QSTR_WIDTH), MP_ROM_INT(DISPLAY_RESX)}, + {MP_ROM_QSTR(MP_QSTR_HEIGHT), MP_ROM_INT(DISPLAY_RESY)}, + {MP_ROM_QSTR(MP_QSTR_FONT_SIZE), MP_ROM_INT(FONT_SIZE)}, + {MP_ROM_QSTR(MP_QSTR_FONT_NORMAL), MP_ROM_INT(FONT_NORMAL)}, + {MP_ROM_QSTR(MP_QSTR_FONT_BOLD), MP_ROM_INT(FONT_BOLD)}, + {MP_ROM_QSTR(MP_QSTR_FONT_MONO), MP_ROM_INT(FONT_MONO)}, + {MP_ROM_QSTR(MP_QSTR_FONT_MONO_BOLD), MP_ROM_INT(FONT_MONO_BOLD)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorui_Display_locals_dict, mod_trezorui_Display_locals_dict_table); diff --git a/core/embed/extmod/modtrezorutils/modtrezorutils.c b/core/embed/extmod/modtrezorutils/modtrezorutils.c index 0f13a030ac..450fdf5ff3 100644 --- a/core/embed/extmod/modtrezorutils/modtrezorutils.c +++ b/core/embed/extmod/modtrezorutils/modtrezorutils.c @@ -131,9 +131,9 @@ STATIC const mp_rom_map_elem_t mp_module_trezorutils_globals_table[] = { MP_ROM_PTR(&mod_trezorutils_set_mode_unprivileged_obj)}, // various built-in constants {MP_ROM_QSTR(MP_QSTR_GITREV), MP_ROM_QSTR(MP_QSTR(GITREV))}, - {MP_ROM_QSTR(MP_QSTR_VERSION_MAJOR), MP_OBJ_NEW_SMALL_INT(VERSION_MAJOR)}, - {MP_ROM_QSTR(MP_QSTR_VERSION_MINOR), MP_OBJ_NEW_SMALL_INT(VERSION_MINOR)}, - {MP_ROM_QSTR(MP_QSTR_VERSION_PATCH), MP_OBJ_NEW_SMALL_INT(VERSION_PATCH)}, + {MP_ROM_QSTR(MP_QSTR_VERSION_MAJOR), MP_ROM_INT(VERSION_MAJOR)}, + {MP_ROM_QSTR(MP_QSTR_VERSION_MINOR), MP_ROM_INT(VERSION_MINOR)}, + {MP_ROM_QSTR(MP_QSTR_VERSION_PATCH), MP_ROM_INT(VERSION_PATCH)}, {MP_ROM_QSTR(MP_QSTR_MODEL), MP_ROM_QSTR(MP_QSTR(TREZOR_MODEL))}, #ifdef TREZOR_EMULATOR {MP_ROM_QSTR(MP_QSTR_EMULATOR), mp_const_true},