aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/zpu/bin
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/zpu/bin')
-rw-r--r--[-rwxr-xr-x]firmware/zpu/bin/bin_to_ram_macro_init.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/zpu/bin/bin_to_ram_macro_init.py b/firmware/zpu/bin/bin_to_ram_macro_init.py
index 65cf2dbdf..085045290 100755..100644
--- a/firmware/zpu/bin/bin_to_ram_macro_init.py
+++ b/firmware/zpu/bin/bin_to_ram_macro_init.py
@@ -12,8 +12,9 @@ def bin_to_ram_macro_init(bin_input_file, ram_init_output_file):
ifile = open(bin_input_file, 'rb')
ofile = open(ram_init_output_file, 'w')
idata = ifile.read()
- fmt = ">%dI" % ((len(idata) / 4),)
- words = struct.unpack(fmt, idata)
+ idata_words = len(idata) / 4
+ fmt = ">%dI"%idata_words
+ words = struct.unpack(fmt, idata[:idata_words*4])
# pad to a multiple of 8 words
r = len(words) % 8