Skip to content

Commit 646fa4b

Browse files
committed
Merge branch 'print_in_place' into 'master'
Print bitfile block numbers in-place spi_test.py: Formatting change for stdout printing of bitfile block loading progress. Avoids excessive consumption of vertical console space. See merge request hdl-libraries/bedrock!217
2 parents 8f1437a + 558be16 commit 646fa4b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

badger/tests/spi_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,14 @@ def remote_program(s, file_name, ad, size):
428428
f = open(file_name, 'rb')
429429
# assume that '.bin' file size is always less than whole pages
430430
for ba in reversed(range(start_p, stop_p)):
431-
print("block %d" % ba)
431+
print("block %d\r" % ba, end='', flush=True)
432432
f.seek((ba << 8) - ad)
433433
bd = f.read(PAGE)
434434
while not (write_enable(s, True)):
435435
time.sleep(WAIT)
436436
page_program(s, ba << 8, bd)
437+
else:
438+
print('')
437439
f.close()
438440
return
439441

0 commit comments

Comments
 (0)