ota flash: print number of blocks

This commit is contained in:
2026-01-23 23:57:45 +00:00
parent 14045825f3
commit 0937fc8b93
+6 -2
View File
@@ -57,9 +57,13 @@ def hexy(h):
def ddec(h):
return "".join("{:02d} ".format(x) for x in bytearray(h))
for i in range(0, 2 + len(rom_image)//BLOCK_SIZE):
# header block 0 plus n full blocks plus partial block at end
num_blocks = 2 + len(rom_image)//BLOCK_SIZE
print(f"{num_blocks} blocks to send")
for i in range(0, num_blocks):
h = hash_for_block(i)
print(f"block {i} {len(data_for_block(i))}")
print(f"block {i}")
sock.send(linked_block(i))