mirror of
https://github.com/MikronMIK32/mik32-uploader.git
synced 2026-01-01 13:37:03 +03:00
Исправлена передача выходного значения и некорректный вывод при ошибках
This commit is contained in:
parent
36c61379d7
commit
bb0b86d37b
@ -277,6 +277,7 @@ def upload_file(
|
|||||||
) * memory_page_size[MemoryType.EEPROM]
|
) * memory_page_size[MemoryType.EEPROM]
|
||||||
t = time.localtime()
|
t = time.localtime()
|
||||||
current_time = time.strftime("%H:%M:%S", t)
|
current_time = time.strftime("%H:%M:%S", t)
|
||||||
|
if result == 0:
|
||||||
print(
|
print(
|
||||||
f"[{current_time}] Wrote {write_size} bytes in {write_time:.2f} seconds (effective {(write_size/(write_time*1024)):.1f} kbyte/s)")
|
f"[{current_time}] Wrote {write_size} bytes in {write_time:.2f} seconds (effective {(write_size/(write_time*1024)):.1f} kbyte/s)")
|
||||||
if (pages.pages_spifi.__len__() > 0):
|
if (pages.pages_spifi.__len__() > 0):
|
||||||
@ -300,6 +301,7 @@ def upload_file(
|
|||||||
) * memory_page_size[MemoryType.SPIFI]
|
) * memory_page_size[MemoryType.SPIFI]
|
||||||
t = time.localtime()
|
t = time.localtime()
|
||||||
current_time = time.strftime("%H:%M:%S", t)
|
current_time = time.strftime("%H:%M:%S", t)
|
||||||
|
if result == 0:
|
||||||
print(
|
print(
|
||||||
f"[{current_time}] Wrote {write_size} bytes in {write_time:.2f} seconds (effective {(write_size/(write_time*1024)):.1f} kbyte/s)")
|
f"[{current_time}] Wrote {write_size} bytes in {write_time:.2f} seconds (effective {(write_size/(write_time*1024)):.1f} kbyte/s)")
|
||||||
gpio_deinit(openocd, mik_version)
|
gpio_deinit(openocd, mik_version)
|
||||||
@ -442,6 +444,7 @@ if __name__ == '__main__':
|
|||||||
print(program_name)
|
print(program_name)
|
||||||
|
|
||||||
if namespace.filepath:
|
if namespace.filepath:
|
||||||
|
exit(
|
||||||
upload_file(
|
upload_file(
|
||||||
namespace.filepath,
|
namespace.filepath,
|
||||||
host=namespace.openocd_host,
|
host=namespace.openocd_host,
|
||||||
@ -459,5 +462,6 @@ if __name__ == '__main__':
|
|||||||
post_action=namespace.post_action,
|
post_action=namespace.post_action,
|
||||||
mik_version=namespace.mcu_type
|
mik_version=namespace.mcu_type
|
||||||
)
|
)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
print("Nothing to upload")
|
print("Nothing to upload")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user