summaryrefslogtreecommitdiff
path: root/src/app/ssd1306-bad-apple/main.cc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-04-16 20:49:36 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-04-16 20:49:36 +0200
commit42e7fdf01c3a5701bb51e93ad6c650c3dbbc5450 (patch)
tree0230d2d4e372f205f43b27a96f4c6355c1e28a37 /src/app/ssd1306-bad-apple/main.cc
parentaa728fb0daeba1c4c15b2514acbbd0fadb8f9cda (diff)
ssd1306-bad-apple: support both 128x64 and 128x32 displays
Diffstat (limited to 'src/app/ssd1306-bad-apple/main.cc')
-rw-r--r--src/app/ssd1306-bad-apple/main.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/app/ssd1306-bad-apple/main.cc b/src/app/ssd1306-bad-apple/main.cc
index 5e89625..d1ecd8d 100644
--- a/src/app/ssd1306-bad-apple/main.cc
+++ b/src/app/ssd1306-bad-apple/main.cc
@@ -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)
{
@@ -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));
@@ -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();
@@ -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();