summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--freeonebook.c12
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);