From 166f001c73e0709e915cb0292a95f3ddf6006389 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sat, 10 Nov 2018 14:35:07 -0500 Subject: add values for button pushes to be checked at a later date --- freeonebook.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/freeonebook.c b/freeonebook.c index 8e5b89e..0dba0cf 100644 --- a/freeonebook.c +++ b/freeonebook.c @@ -4,13 +4,18 @@ #include #include +#define BUTTON_SPECIAL 89 +#define BUTTON_PREVBOOK 91 +#define BUTTON_PREVPAGE 92 +#define BUTTON_NEXTPAGE 95 +#define BUTTON_NEXTCHAPTER 96 +#define BUTTON_NEXTBOOK 100 + #define GPIO_BASEDIR "/sys/class/gpio" #define GPIO_EXPORT GPIO_BASEDIR "/export" -#define ENABLE_LEFT_PATH GPIO_BASEDIR "/gpio5/value" -#define ENABLE_RIGHT_PATH GPIO_BASEDIR "/gpio4/value" - -#define ENABLE_VALUE "1" +#define ENABLE_LEFT_DISPLAY 5 +#define ENABLE_RIGHT_DISPLAY 4 void gpio_write(int port, const char *field, const char *value) { @@ -24,8 +29,8 @@ void gpio_write(int port, const char *field, const char *value) void enable_displays(void) { - gpio_write(5, "value", "1"); - gpio_write(4, "value", "1"); + gpio_write(ENABLE_LEFT_DISPLAY, "value", "1"); + gpio_write(ENABLE_RIGHT_DISPLAY, "value", "1"); } void gpio_init(void) -- cgit v1.2.1