From: GetAway Date: Sat, 10 Mar 2018 19:47:13 +0000 (+0100) Subject: msgbox: add RC Support for more Hardware X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=702434522a37a4d34261ccdc87efadd00e244b69;p=msgbox.git msgbox: add RC Support for more Hardware - fix CONFIGDIR - fix FONTDIR - bump version 2.13 please build with -DHAVE_ARM_HARDWARE -DHAVE_COOL_HARDWARE --- diff --git a/io.c b/io.c index 38fae44..f7c2547 100644 --- 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__ " "); diff --git a/io.h b/io.h index 2cb93f8..bb0af03 100644 --- 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); diff --git a/msgbox.c b/msgbox.c index f6021e2..0f4b934 100644 --- a/msgbox.c +++ b/msgbox.c @@ -17,14 +17,22 @@ 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 diff --git a/msgbox.h b/msgbox.h index 13ed576..276d298 100644 --- a/msgbox.h +++ b/msgbox.h @@ -25,6 +25,13 @@ #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 index 0000000..bad11e3 --- /dev/null +++ b/rc_device.h @@ -0,0 +1,21 @@ +#ifdef HAVE_CONFIG_H +#include +#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 +