Skip to content

Commit 5b661eb

Browse files
committed
tools: fix bin2header.py, wrong check order
Signed-off-by: perigoso <perigoso@riseup.net>
1 parent caa891b commit 5b661eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/bin2header.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ def print_array(output_file, name, byte_array):
2323
num_bytes = sum(1 for byte in byte_array)
2424

2525
for i in range(num_bytes):
26-
if (i + 1) % 16 == 0:
27-
print(f'0x{byte_array[i]:02X},', file=output_file, end='\r\n\t')
28-
elif (i + 1) == num_bytes:
26+
if (i + 1) == num_bytes:
2927
print(f'0x{byte_array[i]:02X}', file=output_file, end='};\r\n')
28+
elif (i + 1) % 16 == 0:
29+
print(f'0x{byte_array[i]:02X},', file=output_file, end='\r\n\t')
3030
else:
3131
print(f'0x{byte_array[i]:02X}, ', file=output_file, end='')
3232

0 commit comments

Comments
 (0)