Skip to content

Commit 25e3686

Browse files
committed
Also display raw .hex file MD5 sum
1 parent 76bfed8 commit 25e3686

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

convertHexToByteArray.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,20 @@ def main():
6262
padding = [0xFF] * (loaderLen - len(bootloader_bin))
6363
md5.update(bytearray(padding))
6464

65+
# Calculatae md5sum from the original file so we know which disk file it came from
66+
filemd5 = hashlib.md5()
67+
fd = open(hexfile, 'rb')
68+
filemd5.update(fd.read())
69+
fd.close()
70+
6571
# Filename without full path and without ".hex"
6672
filename = os.path.splitext(os.path.basename(hexfile))[0]
6773

6874
# Print header
6975
print '// File =', filename + ".hex"
7076
print '// Loader start:', hex(loaderStart), 'length', loaderLen
71-
print '// MD5 sum =', md5.hexdigest()
77+
print '// Bootloader MD5 sum =', md5.hexdigest()
78+
print '// Original file MD5 sum =', filemd5.hexdigest()
7279
print
7380
print 'const uint8_t', filename + '_hex [] PROGMEM = {'
7481

0 commit comments

Comments
 (0)