flash_gen: fix endianness

This commit is contained in:
occheung 2020-12-18 17:44:38 +08:00
parent f1069d951d
commit 8ce3200b5d

View File

@ -25,7 +25,7 @@ def write_record(f, key, value):
key_size = len(key) + 1 key_size = len(key) + 1
value_size = len(value) value_size = len(value)
record_size = key_size + value_size + 4 record_size = key_size + value_size + 4
f.write(struct.pack("<l", record_size)) f.write(struct.pack(">l", record_size))
f.write(key.encode()) f.write(key.encode())
f.write(b"\x00") f.write(b"\x00")
f.write(value) f.write(value)