all: Reformat C and Python source code with tools/codeformat.py.

This is run with uncrustify 0.70.1, and black 19.10b0.
This commit is contained in:
Damien George
2020-02-27 15:36:53 +11:00
parent 3f39d18c2b
commit 69661f3343
539 changed files with 10496 additions and 8254 deletions

View File

@@ -8,33 +8,33 @@ assert len(sys.argv) == 4
md5 = hashlib.md5()
with open(sys.argv[3], 'wb') as fout:
with open(sys.argv[3], "wb") as fout:
with open(sys.argv[1], 'rb') as f:
with open(sys.argv[1], "rb") as f:
data_flash = f.read()
fout.write(data_flash)
# First 4 bytes include flash size, etc. which may be changed
# by esptool.py, etc.
md5.update(data_flash[4:])
print('flash ', len(data_flash))
print("flash ", len(data_flash))
with open(sys.argv[2], 'rb') as f:
with open(sys.argv[2], "rb") as f:
data_rom = f.read()
pad = b'\xff' * (SEGS_MAX_SIZE - len(data_flash))
pad = b"\xff" * (SEGS_MAX_SIZE - len(data_flash))
assert len(pad) >= 4
fout.write(pad[:-4])
md5.update(pad[:-4])
len_data = struct.pack("I", SEGS_MAX_SIZE + len(data_rom))
fout.write(len_data)
md5.update(len_data)
print('padding ', len(pad))
print("padding ", len(pad))
fout.write(data_rom)
md5.update(data_rom)
print('irom0text', len(data_rom))
print("irom0text", len(data_rom))
fout.write(md5.digest())
print('total ', SEGS_MAX_SIZE + len(data_rom))
print('md5 ', md5.hexdigest())
print("total ", SEGS_MAX_SIZE + len(data_rom))
print("md5 ", md5.hexdigest())