diff options
| author | Jakob Kaivo <jakob@kaivo.net> | 2018-11-12 15:00:44 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jakob@kaivo.net> | 2018-11-12 15:00:44 -0500 |
| commit | 65f76a7f96b463a129da479b8256310dd538cd3f (patch) | |
| tree | c901ecc4d74de71c8421afbd6a35f3767a001bbd | |
| parent | 3ad51d2711741a9a04cf66bd1422da952f7229da (diff) | |
loading at least one image correctly
| -rw-r--r-- | freeonebook.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/freeonebook.c b/freeonebook.c index 13f970a..3e2a008 100644 --- a/freeonebook.c +++ b/freeonebook.c @@ -7,7 +7,6 @@ #include "gpio.h" #include "fb.h" -#define FBSIZE (1186848 * 2) #define SDPATH "/run/media/mmcblk0p1" void halt(void) @@ -31,8 +30,6 @@ void poweroff(int reason) if (reason == GPIO_LOWBATTERY) { printf("low battery\n"); - } else { - fb_blank(); } exit(0); @@ -59,12 +56,10 @@ void buttonpress(int button) case BUTTON_PREVPAGE: printf("previous page\n"); - fb_loadimage(SDPATH "/right-screen.dat"); break; case BUTTON_NEXTPAGE: printf("next page\n"); - fb_loadimage(SDPATH "/left-screen.dat"); break; default: @@ -83,8 +78,8 @@ int main(int argc, char *argv[]) atexit(halt); printf("adding watchers\n"); - //gpio_watch(GPIO_LOWBATTERY, poweroff); - //gpio_watch(GPIO_SHUTDOWN, poweroff); + gpio_watch(GPIO_LOWBATTERY, poweroff); + gpio_watch(GPIO_SHUTDOWN, poweroff); gpio_watch(BUTTON_SPECIAL, buttonpress); gpio_watch(BUTTON_PREVBOOK, buttonpress); gpio_watch(BUTTON_PREVPAGE, buttonpress); @@ -94,7 +89,8 @@ int main(int argc, char *argv[]) printf("initializing framebuffer\n"); fb_init(); - fb_blank(); + fb_loadimage(RIGHT_SCREEN, SDPATH "/right.gray"); + fb_loadimage(LEFT_SCREEN, SDPATH "/left.gray"); for (;;) { sleep(INT_MAX); |
