Loading src/app/ssd1306-bad-apple/convert +2 −2 Original line number Diff line number Diff line #!/bin/sh # ./convert.sh <file> -r <frame rate> [additional ffmpeg args] # [size=WxH] ./convert.sh <file> -r <frame rate> [additional ffmpeg args] set -eu Loading @@ -8,7 +8,7 @@ mkdir -p tmp ffmpeg -i "$@" tmp/frame%4d.png parallel mogrify -resize 128x64 -threshold 50% -- tmp/*.png parallel mogrify -resize "${size:-128x64}" -threshold 50% -- tmp/*.png echo "const unsigned char frame_rate = $3;" > frames.cc ./frames-to-cc tmp/*.png >> frames.cc Loading src/app/ssd1306-bad-apple/frames-to-cc +2 −2 Original line number Diff line number Diff line #!/usr/bin/env python3 from PIL import Image import os import sys import zlib buf_w = 128 buf_h = 64 buf_w, buf_h = map(int, os.getenv("size", "128x64").split("x")) def load_image(filename): im = Image.open(filename) Loading src/app/ssd1306-bad-apple/main.cc +4 −4 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ volatile unsigned char timer_done = 0; #include "frames.cc" __attribute__((section(".leaRAM"))) unsigned char img_buf[(128 * 64 / 8) * 3]; __attribute__((section(".leaRAM"))) unsigned char img_buf[(SSD1306_WIDTH * SSD1306_HEIGHT / 8) * 3]; int main(void) { Loading @@ -35,7 +35,7 @@ int main(void) timer_done = 0; timer.start(1); ssd1306.showImage(img_buf + (128 * 64 / 8 * 2), 128 * 64 / 8); ssd1306.showImage(img_buf + (SSD1306_WIDTH * SSD1306_HEIGHT / 8 * 2), SSD1306_WIDTH * SSD1306_HEIGHT / 8); inflate(frames[i], sizeof(img_buf), img_buf, sizeof(img_buf)); Loading @@ -47,7 +47,7 @@ int main(void) timer_done = 0; timer.start(1); ssd1306.showImage(img_buf + (128 * 64 / 8 * 0), 128 * 64 / 8); ssd1306.showImage(img_buf + (SSD1306_WIDTH * SSD1306_HEIGHT / 8 * 0), SSD1306_WIDTH * SSD1306_HEIGHT / 8); while (!timer_done) { arch.idle(); Loading @@ -57,7 +57,7 @@ int main(void) timer_done = 0; timer.start(1); ssd1306.showImage(img_buf + (128 * 64 / 8 * 1), 128 * 64 / 8); ssd1306.showImage(img_buf + (SSD1306_WIDTH * SSD1306_HEIGHT / 8 * 1), SSD1306_WIDTH * SSD1306_HEIGHT / 8); while (!timer_done) { arch.idle(); Loading Loading
src/app/ssd1306-bad-apple/convert +2 −2 Original line number Diff line number Diff line #!/bin/sh # ./convert.sh <file> -r <frame rate> [additional ffmpeg args] # [size=WxH] ./convert.sh <file> -r <frame rate> [additional ffmpeg args] set -eu Loading @@ -8,7 +8,7 @@ mkdir -p tmp ffmpeg -i "$@" tmp/frame%4d.png parallel mogrify -resize 128x64 -threshold 50% -- tmp/*.png parallel mogrify -resize "${size:-128x64}" -threshold 50% -- tmp/*.png echo "const unsigned char frame_rate = $3;" > frames.cc ./frames-to-cc tmp/*.png >> frames.cc Loading
src/app/ssd1306-bad-apple/frames-to-cc +2 −2 Original line number Diff line number Diff line #!/usr/bin/env python3 from PIL import Image import os import sys import zlib buf_w = 128 buf_h = 64 buf_w, buf_h = map(int, os.getenv("size", "128x64").split("x")) def load_image(filename): im = Image.open(filename) Loading
src/app/ssd1306-bad-apple/main.cc +4 −4 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ volatile unsigned char timer_done = 0; #include "frames.cc" __attribute__((section(".leaRAM"))) unsigned char img_buf[(128 * 64 / 8) * 3]; __attribute__((section(".leaRAM"))) unsigned char img_buf[(SSD1306_WIDTH * SSD1306_HEIGHT / 8) * 3]; int main(void) { Loading @@ -35,7 +35,7 @@ int main(void) timer_done = 0; timer.start(1); ssd1306.showImage(img_buf + (128 * 64 / 8 * 2), 128 * 64 / 8); ssd1306.showImage(img_buf + (SSD1306_WIDTH * SSD1306_HEIGHT / 8 * 2), SSD1306_WIDTH * SSD1306_HEIGHT / 8); inflate(frames[i], sizeof(img_buf), img_buf, sizeof(img_buf)); Loading @@ -47,7 +47,7 @@ int main(void) timer_done = 0; timer.start(1); ssd1306.showImage(img_buf + (128 * 64 / 8 * 0), 128 * 64 / 8); ssd1306.showImage(img_buf + (SSD1306_WIDTH * SSD1306_HEIGHT / 8 * 0), SSD1306_WIDTH * SSD1306_HEIGHT / 8); while (!timer_done) { arch.idle(); Loading @@ -57,7 +57,7 @@ int main(void) timer_done = 0; timer.start(1); ssd1306.showImage(img_buf + (128 * 64 / 8 * 1), 128 * 64 / 8); ssd1306.showImage(img_buf + (SSD1306_WIDTH * SSD1306_HEIGHT / 8 * 1), SSD1306_WIDTH * SSD1306_HEIGHT / 8); while (!timer_done) { arch.idle(); Loading