diff options
author | Brett Weiland <brett_weiland@bpcsapce.com> | 2022-09-27 16:14:28 -0500 |
---|---|---|
committer | Brett Weiland <brett_weiland@bpcsapce.com> | 2022-09-27 16:14:28 -0500 |
commit | 94304b11e7220f060dbc345de5fa1952d0465016 (patch) | |
tree | f16e84c54b27f67e089ded1175fbf8b561896b42 /src/compile_eeprom.py | |
parent | 7b006d6f2032ac46074d693ae59a971bee327ace (diff) |
working on serial syncronization for programming eeprom
Diffstat (limited to 'src/compile_eeprom.py')
-rwxr-xr-x | src/compile_eeprom.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/compile_eeprom.py b/src/compile_eeprom.py index 52dbbfc..dee9341 100755 --- a/src/compile_eeprom.py +++ b/src/compile_eeprom.py @@ -26,8 +26,8 @@ page_cnt = 4 # also note we have no protection from using unsed chars, I can't let this project # get to big for litteraly no reason -header.write("/** GENERATED BY EEPROM COMPILER SCRIPT **/\n\n") -header.write("// FONTS\n") +header.write("/** GENERATED BY EEPROM COMPILER SCRIPT **/\r\n\r\n") +header.write("// FONTS\r\n") for file in os.listdir("{}/fonts/".format(data_path)): path = "{}/fonts/{}".format(data_path, file) @@ -36,22 +36,22 @@ for file in os.listdir("{}/fonts/".format(data_path)): font_bdf = BdfFontFile.BdfFontFile(font_fd) font_name = file.split('.')[0].capitalize() - header.write("#define FONT_{}_ADDR\t0x{:04x}\n".format(font_name, output.tell())) + header.write("#define FONT_{}_ADDR\t0x{:04x}\r\n".format(font_name, output.tell())) first_char = False for char in enumerate(font_bdf.glyph): if char[1]: if not first_char: first_char = True - header.write(("#define FONT_{}_FIRST_CHAR\t{}\n" - "#define FONT_{}_WIDTH\t{}\n" - "#define FONT_{}_HEIGHT\t{}\n").format( + header.write(("#define FONT_{}_FIRST_CHAR\t{}\r\n" + "#define FONT_{}_WIDTH\t{}\r\n" + "#define FONT_{}_HEIGHT\t{}\r\n").format( font_name, char[0], font_name, char[1][-1].size[0], font_name, char[1][-1].size[1])) output.write(char[1][-1].tobytes('raw')) -header.write("\n\n// IMAGES\n#define IMG_BEGIN\t0x{:04x}\n".format(output.tell())) +header.write("\r\n\r\n// IMAGES\r\n#define IMG_BEGIN\t0x{:04x}\r\n".format(output.tell())) image_cnt = 0 @@ -65,9 +65,9 @@ for file in os.listdir("{}/images/".format(data_path)): image_bitmap_remapped = [] image = Image.open(image_fd) if not image.mode == 'RGB': - print("this script only compiles RGB formatted photos! (I'm lazy\n") + print("this script only compiles RGB formatted photos! (I'm lazy\r\n") exit(1) - header.write("#define IMG_{}_ADDR\t0x{:04x}\n".format( + header.write("#define IMG_{}_ADDR\t0x{:04x}\r\n".format( file.split('.')[0].capitalize(), output.tell())) for byte in range(0, len(image.tobytes()), 3): @@ -98,7 +98,7 @@ for file in os.listdir("{}/images/".format(data_path)): ((bit % 8) - (extract_bit % 8)) [output.write(byte.to_bytes(1, 'big')) for byte in image_bitmap_remapped] -header.write("#define IMG_COUNT\t{}\n\n".format(image_cnt)) +header.write("#define IMG_COUNT\t{}\r\n\r\n".format(image_cnt)) @@ -107,7 +107,7 @@ print("EEPROM used: {}% ({} out of {} bits)".format( output.tell(), eeprom_length)) if(output.tell() > eeprom_length): - print("WARNING: You've used more eeprom then there is available!\n") + print("WARNING: You've used more eeprom then there is available!\r\n") output.close() header.close() |