fix combine/prepare script for python3

This commit is contained in:
Pavol Rusnak 2017-02-04 11:20:58 +01:00
parent 801ca6e644
commit 2a22d9f0ed
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
1 changed files with 6 additions and 4 deletions

View File

@ -1,10 +1,12 @@
#!/usr/bin/env python2
#!/usr/bin/env python
from __future__ import print_function
bl = open('bl.bin').read()
fw = open('fw.bin').read()
combined = bl + fw[:256] + (32768-256)*'\x00' + fw[256:]
open('combined.bin', 'w').write(combined)
print 'bootloader : %d bytes' % len(bl)
print 'firmware : %d bytes' % len(fw)
print 'combined : %d bytes' % len(combined)
print('bootloader : %d bytes' % len(bl))
print('firmware : %d bytes' % len(fw))
print('combined : %d bytes' % len(combined))