]> git.webhop.me Git - msgbox.git/commitdiff
msgbox: add RC Support for more Hardware
authorGetAway <get-away@t-online.de>
Sat, 10 Mar 2018 19:47:13 +0000 (20:47 +0100)
committerGetAway <get-away@t-online.de>
Sat, 10 Mar 2018 19:47:13 +0000 (20:47 +0100)
- fix CONFIGDIR
- fix FONTDIR
- bump version 2.13

please build with -DHAVE_ARM_HARDWARE
                  -DHAVE_COOL_HARDWARE

io.c
io.h
msgbox.c
msgbox.h
rc_device.h [new file with mode: 0644]

diff --git a/io.c b/io.c
index 38fae446f766fae293a8c27624129f6fa25cc05f..f7c254759f949cbe2861d594d372a82ffb748154 100644 (file)
--- a/io.c
+++ b/io.c
@@ -19,6 +19,7 @@
 
 #include "current.h"
 #include "io.h"
+#include "rc_device.h"
 
 extern int instance;
 struct input_event ev;
@@ -28,6 +29,8 @@ static int rc;
 int InitRC(void)
 {
        rc = open(RC_DEVICE, O_RDONLY | O_CLOEXEC);
+       if(rc == -1)
+               rc = open(RC_DEVICE_FALLBACK, O_RDONLY | O_CLOEXEC);
        if(rc == -1)
        {
                perror(__plugin__ " <open remote control>");
diff --git a/io.h b/io.h
index 2cb93f8d93d55ad582d79db6d098774ccc3ab2f4..bb0af03799e91de3e26c5b5c27701658a7ce321d 100644 (file)
--- a/io.h
+++ b/io.h
@@ -1,8 +1,6 @@
 #ifndef __IO_H__
 #define __IO_H__
 
-#define RC_DEVICE      "/dev/input/nevis_ir"
-
 int InitRC(void);
 int CloseRC(void);
 int RCKeyPressed(void);
index f6021e24fe6f330035868ade07229ca96fc42f61..0f4b93484bf032c782da055fc9097001e0dde240 100644 (file)
--- a/msgbox.c
+++ b/msgbox.c
        typeof (b) __b = (b); \
        __a > __b ? __a : __b; })
 
-#define M_VERSION 2.12
+#define M_VERSION 2.13
 
-#define NCF_FILE       "/var/tuxbox/config/neutrino.conf"
-#define HDF_FILE       "/tmp/.msgbox_hidden"
+#ifndef CONFIGDIR
+#define CONFIGDIR "/var/tuxbox/config"
+#endif
+#ifndef FONTDIR
+#define FONTDIR        "/share/fonts"
+#endif
 
-#define FONT2 "/share/fonts/pakenham.ttf"
+#define NCF_FILE CONFIGDIR "/neutrino.conf"
+#define HDF_FILE "/tmp/.msgbox_hidden"
+
+char FONT[128] = FONTDIR "/neutrino.ttf";
 // if font is not in usual place, we look here:
-char FONT[128]="/share/fonts/neutrino.ttf";
+#define FONT2 CONFIGDIR"/pakenham.ttf"
+
 
 //                                             CMCST,   CMCS,  CMCT,    CMC,    CMCIT,  CMCI,   CMHT,   CMH
 //                                             WHITE,   BLUE0, TRANSP,  CMS,    ORANGE, GREEN,  YELLOW, RED
index 13ed5763e878cd5f55cd6e51114f7722985340a8..276d298edb5e758b5fd38d7692aac72d68310ad9 100644 (file)
--- a/msgbox.h
+++ b/msgbox.h
 #include FT_CACHE_H
 #include FT_CACHE_SMALL_BITMAPS_H
 
+#ifndef FB_DEVICE
+#define FB_DEVICE      "/dev/fb/0"
+#endif
+#ifndef FB_DEVICE_FALLBACK
+#define FB_DEVICE_FALLBACK     "/dev/fb0"
+#endif
+
 #define MAX_BUTTONS 24
 #define BUFSIZE        4095
 
@@ -161,9 +168,5 @@ extern int instance;
 int get_instance(void);
 void put_instance(int pval);
 
-#ifndef FB_DEVICE
-#define FB_DEVICE      "/dev/fb/0"
-#endif
-
 #endif
 
diff --git a/rc_device.h b/rc_device.h
new file mode 100644 (file)
index 0000000..bad11e3
--- /dev/null
@@ -0,0 +1,21 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if HAVE_COOL_HARDWARE
+#define RC_DEVICE "/dev/input/nevis_ir"
+#define RC_DEVICE_FALLBACK "/dev/input/event0"
+
+#elif HAVE_SPARK_HARDWARE
+#define RC_DEVICE "/dev/input/nevis_ir"
+#define RC_DEVICE_FALLBACK "/dev/input/event1"
+
+#elif HAVE_DUCKBOX_HARDWARE
+#define RC_DEVICE "/dev/input/event0"
+#define RC_DEVICE_FALLBACK "/dev/input/event1"
+#else
+#define RC_DEVICE "/dev/input/event1"
+#define RC_DEVICE_FALLBACK "/dev/input/event0"
+
+#endif
+