Skip to content

Commit 4e7e2c9

Browse files
Merge pull request #275 from MikroElektronika/update/7-2-0-release-flash-tweaking
Changed MCU card info to show Flash size in Bytes
2 parents 842cb07 + 36d1ed1 commit 4e7e2c9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/add_extra_index_info.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ def get_card_info_from_db(db_path, device_name):
116116
ram_int = int(ram) / 1024
117117
ram = str(ram_int)
118118

119+
# Process Flash value to display it in KB or B
120+
if int(flash) >= 1024:
121+
flash_int = int(flash) / 1024
122+
flash = str(flash_int) + " KB"
123+
else:
124+
flash = flash + " B"
125+
119126
# Query to get package_uid
120127
cursor.execute("""
121128
SELECT DISTINCT package_uid
@@ -168,7 +175,7 @@ def form_extra_information(asset_type, package_name, asset_url, token):
168175
'extra_information' :
169176
{
170177
'RAM Size' : f'{ram_size} KB',
171-
'Flash Size' : f'{flash_size} KB',
178+
'Flash Size' : flash_size,
172179
'Maximum Speed' : f'{max_speed} MHz',
173180
'Core Name' : core_name,
174181
'Pin Count': pin_num,

0 commit comments

Comments
 (0)