From b8d98e4f4528e47b4f07eb2a911b94734acc4936 Mon Sep 17 00:00:00 2001 From: BehleZebub <116460179+BehleZebub@users.noreply.github.com> Date: Sat, 22 Oct 2022 23:42:40 +0200 Subject: [PATCH] Update generate_world_map.bin.py forced endianess on outfile.write() to little endian and closed outfile at the end --- firmware/tools/generate_world_map.bin.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/firmware/tools/generate_world_map.bin.py b/firmware/tools/generate_world_map.bin.py index 38f575e2..a8ac68d7 100755 --- a/firmware/tools/generate_world_map.bin.py +++ b/firmware/tools/generate_world_map.bin.py @@ -29,10 +29,10 @@ outfile = open('../../sdcard/ADSB/world_map.bin', 'wb') Image.MAX_IMAGE_PIXELS = None im = Image.open("../../sdcard/ADSB/world_map.jpg") pix = im.load() - -outfile.write(struct.pack('H', im.size[0])) -outfile.write(struct.pack('H', im.size[1])) - +# Write as unsigned short (2 bytes) as little endian +outfile.write(struct.pack('> 5) << 5 # pixel_lcd |= (pix[x, y][1] >> 5) << 2 # pixel_lcd |= (pix[x, y][2] >> 6) - line += struct.pack('H', pixel_lcd) + line += struct.pack('