Tools: fixed python3 error in make_intel_hex.py
This commit is contained in:
parent
88ec03ce5a
commit
77929dabb3
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys, os, shutil
|
||||
import sys, os, shutil, struct
|
||||
import intelhex
|
||||
|
||||
# make two intel hex files, one including bootloader and one without
|
||||
@ -27,7 +27,11 @@ if not os.path.exists(bootloaderfile):
|
||||
sys.exit(1)
|
||||
|
||||
blimage = bytes(open(bootloaderfile, "rb").read())
|
||||
blimage += bytes(chr(255) * (reserve_kb * 1024 - len(blimage)))
|
||||
blimage += bytes(struct.pack('B',255) * (reserve_kb * 1024 - len(blimage)))
|
||||
|
||||
if len(blimage) != reserve_kb * 1024:
|
||||
print("Bad blimage size %u" % len(blimage))
|
||||
sys.exit(1)
|
||||
|
||||
appimage = bytes(open(binfile,"rb").read())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user