mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-27 08:38:07 +00:00
tools: move code generating tools to tools/codegen
This commit is contained in:
parent
98bdd99b97
commit
da8cc37a54
@ -14,7 +14,7 @@ fields = [
|
|||||||
'segwit',
|
'segwit',
|
||||||
]
|
]
|
||||||
|
|
||||||
coins = json.load(open('../../trezor-common/coins.json', 'r'))
|
coins = json.load(open('../../../trezor-common/coins.json', 'r'))
|
||||||
|
|
||||||
print('COINS = [')
|
print('COINS = [')
|
||||||
for c in coins:
|
for c in coins:
|
@ -1,4 +1,8 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# script used to generate /embed/extmod/modtrezorui/font_*_*.c
|
||||||
|
|
||||||
|
|
||||||
import freetype
|
import freetype
|
||||||
|
|
||||||
MIN_GLYPH = ord(' ')
|
MIN_GLYPH = ord(' ')
|
@ -3,9 +3,11 @@
|
|||||||
import binascii
|
import binascii
|
||||||
import ed25519raw
|
import ed25519raw
|
||||||
|
|
||||||
|
|
||||||
def hex_to_c(s):
|
def hex_to_c(s):
|
||||||
return '"\\x' + '\\x'.join([s[i:i + 2] for i in range(0, len(s), 2)]) + '"'
|
return '"\\x' + '\\x'.join([s[i:i + 2] for i in range(0, len(s), 2)]) + '"'
|
||||||
|
|
||||||
|
|
||||||
for c in 'ABCDEFGHI':
|
for c in 'ABCDEFGHI':
|
||||||
print()
|
print()
|
||||||
seckey = c.encode() * 32
|
seckey = c.encode() * 32
|
@ -1,4 +1,7 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
# script used to generate /embed/extmod/modtrezorui/loader.h
|
||||||
|
|
||||||
import math
|
import math
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -15,7 +18,7 @@ with open('loader.h', 'wt') as f:
|
|||||||
c = {}
|
c = {}
|
||||||
for i in [5, 15]:
|
for i in [5, 15]:
|
||||||
if (inner - 0.5 <= d) and (d <= inner + 0.5):
|
if (inner - 0.5 <= d) and (d <= inner + 0.5):
|
||||||
c[i] = 15 * (d - inner + 0.5);
|
c[i] = 15 * (d - inner + 0.5)
|
||||||
elif (inner + 0.5 <= d) and (d <= inner + 1.5):
|
elif (inner + 0.5 <= d) and (d <= inner + 1.5):
|
||||||
c[i] = 15
|
c[i] = 15
|
||||||
elif (inner + 1.5 <= d) and (d <= inner + 2.5):
|
elif (inner + 1.5 <= d) and (d <= inner + 2.5):
|
Loading…
Reference in New Issue
Block a user