Allows for all template features

This commit is contained in:
Rune Harlyk
2024-03-29 17:17:46 +01:00
committed by Rune Harlyk
parent f3e5a66589
commit f67071fd74
5 changed files with 12 additions and 16 deletions
+1 -4
View File
@@ -52,9 +52,6 @@ def gzip_file(file):
copyfileobj(f_in, f_out)
os.remove(file)
def is_compressed(filetype):
return filetype.lower() in ['zip', 'gz', 'rar', '7z', 'jpg', 'jpeg', 'png', 'mp4', 'mp3']
def flag_exists(flag):
for define in buildFlags.get("CPPDEFINES"):
if (define == flag or (isinstance(define, list) and define[0] == flag)):
@@ -76,7 +73,7 @@ def build_progmem():
progmem.write(f'// {asset_path}\n')
progmem.write(f'const uint8_t {asset_var}[] = {{\n ')
file_data = gzip.compress(path.read_bytes()) if not is_compressed(filetype) else path.read_bytes()
file_data = gzip.compress(path.read_bytes())
for i, byte in enumerate(file_data):
if i and not (i % 16):