First init.

This commit is contained in:
2025-10-12 09:13:56 +02:00
commit 1548aeaf9b
458 changed files with 118808 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
PY=python3
define HEADER
/**
* This file is autogenerated, do not edit.
* Run `make` from the scripts directory to produce splash.h
*
* Splashes will be stored in PROGMEM (flash).
* If SSD1306_NO_SPLASH is defined, the splashes are omitted.
*/
#ifndef SSD1306_NO_SPLASH
/* clang-format off */
endef
define FOOTER
/* clang-format on */
#endif
endef
export HEADER
export FOOTER
splash.h: make_splash.py splash1.png splash2.png
echo "$$HEADER" > $@
${PY} make_splash.py splash1.png splash1 >>$@
${PY} make_splash.py splash2.png splash2 >>$@
echo "$$FOOTER" >> $@
clean:
rm -f splash.h

View File

@@ -0,0 +1,38 @@
#!/usr/bin/env python3
# pip install pillow to get the PIL module
import sys
from PIL import Image
def main(fn, id):
image = Image.open(fn)
print("\n"
"#define {id}_width {w}\n"
"#define {id}_height {h}\n"
"\n"
"const uint8_t PROGMEM {id}_data[] = {{\n"
.format(id=id, w=image.width, h=image.height), end='')
for y in range(0, image.height):
for x in range(0, (image.width + 7)//8 * 8):
if x == 0:
print(" ", end='')
if x % 8 == 0:
print("0b", end='')
bit = '0'
if x < image.width and image.getpixel((x,y)) != 0:
bit = '1'
print(bit, end='')
if x % 8 == 7:
print(",", end='')
print()
print("};")
if __name__ == '__main__':
if len(sys.argv) < 3:
print("Usage: {} <imagefile> <id>\n".format(sys.argv[0]), file=sys.stderr);
sys.exit(1)
fn = sys.argv[1]
id = sys.argv[2]
main(fn, id)

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B