]> git.webhop.me Git - tuxwetter.git/commitdiff
tuxwetter: add RC Support for more Hardware
authorGetAway <get-away@t-online.de>
Sat, 10 Mar 2018 21:45:38 +0000 (22:45 +0100)
committerGetAway <get-away@t-online.de>
Sat, 10 Mar 2018 21:45:38 +0000 (22:45 +0100)
- fix CONFIGDIR
- fix FONTDIR
- bump version 4.12

please build with -DHAVE_ARM_HARDWARE
                  -DHAVE_COOL_HARDWARE

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

diff --git a/io.c b/io.c
index feff64e08176d42bd005ea66d70f224519f1c1c0..e9ae40f2cf99d1c3aa522fc781c4c0d8beff82d7 100644 (file)
--- a/io.c
+++ b/io.c
@@ -19,6 +19,7 @@
 
 #include "io.h"
 #include "tuxwetter.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("tuxwetter <open remote control>");
diff --git a/io.h b/io.h
index 6eba5e24b87164da57c7ae675fafd0c6f2c94747..0cb5413c6f5d99c87afb6d5e3678e5c3daf336c5 100644 (file)
--- a/io.h
+++ b/io.h
@@ -2,8 +2,6 @@
 
 #define __IO_H__
 
-#define RC_DEVICE      "/dev/input/nevis_ir"
-
 int InitRC(void);
 int CloseRC(void);
 int RCKeyPressed(void);
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
+
diff --git a/text.c b/text.c
index 4f3b608ce21f815eaf2647d7e6dbe919a0393f5e..994c066a1260721c7c7e0889048f4f72e8c413d4 100644 (file)
--- a/text.c
+++ b/text.c
@@ -146,6 +146,7 @@ void TranslateString(char *src, size_t size)
 FT_Error MyFaceRequester(FTC_FaceID face_id, FT_Library lib, FT_Pointer request_data, FT_Face *aface)
 {
        FT_Error result;
+       (void)request_data;
 
        result = FT_New_Face(lib, face_id, 0, aface);
 
index 60e73cd61e07e64618f9dccbfb6737fe54732fd8..97826f244fdc457cf7300b38480bb5b862922a89 100644 (file)
 #include "gifdecomp.h"
 #include "icons.h"
 
-#define P_VERSION "4.11"
+#define P_VERSION "4.12"
 #define S_VERSION ""
 
 
-char CONVERT_LIST[]= CONFIGDIR "/convert.list";
-#define CFG_FILE     CONFIGDIR "/tuxwetter.conf"
-#define MCF_FILE     CONFIGDIR "/tuxwetter.mcfg"
-//#define TIME_FILE    CONFIGDIR "/swisstime"
-#define START_PIC       CONFIGDIR "/startbild.jpg"
-#define TUX_ICON     CONFIGDIR "/tuxwetter.png"
-#define NCF_FILE       "/var/tuxbox/config/neutrino.conf"
-#define ECF_FILE       "/var/tuxbox/config/enigma/config"
-#define BMP_FILE       "tuxwettr.bmp"
+char CONVERT_LIST[]= CFG_TUXWET "/convert.list";
+#define CFG_FILE     CFG_TUXWET "/tuxwetter.conf"
+#define MCF_FILE     CFG_TUXWET "/tuxwetter.mcfg"
+//#define TIME_FILE    CFG_TUXWET "/swisstime"
+#define START_PIC       CFG_TUXWET "/startbild.jpg"
+#define TUX_ICON     CFG_TUXWET "/tuxwetter.png"
+#define NCF_FILE     CONFIGDIR "/neutrino.conf"
+#define ECF_FILE        CONFIGDIR "/enigma/config"
+//#define BMP_FILE     "tuxwettr.bmp"
 #define JPG_FILE       "/tmp/picture.jpg"
 #define GIF_FILE       "/tmp/picture.gif"
 #define GIF_MFILE      "/tmp/gpic"
@@ -84,11 +84,10 @@ void TrimString(char *strg);
 // Color table stuff
 static const char menucoltxt[][25]={"Content_Selected_Text","Content_Selected","Content_Text","Content","Content_inactive_Text","Content_inactive","Head_Text","Head"};
 
-
-//#define FONT "/usr/share/fonts/md_khmurabi_10.ttf"
-#define FONT2 "/share/fonts/pakenham.ttf"
+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 FONTDIR "/pakenham.ttf"
+
 
 //                                         CMCST,  CMCS,   CMCT,   CMC,    CMCIT,  CMCI,   CMHT,   CMH
 //                                         WHITE,  BLUE0,  TRANSP, CMS,    ORANGE, GREEN,  YELLOW, RED
@@ -2975,7 +2974,9 @@ PLISTENTRY pl=&epl;
        }
 
        //init framebuffer
-       fb = open(FB_DEVICE, O_RDWR);
+       fb=open(FB_DEVICE, O_RDWR);
+       if (fb < 0)
+               fb=open(FB_DEVICE_FALLBACK, O_RDWR);
        if(fb == -1)
        {
                perror("tuxwetter <open framebuffer device>");
index 1aab88e496529b343ae0d4ea1a8ae7421fdb1896..c9c9ec3fb15b1c601f6f9d454c760e30a0d03ec6 100644 (file)
 #include FT_CACHE_H
 #include FT_CACHE_SMALL_BITMAPS_H
 
-#ifndef HAVE_DREAMBOX_HARDWARE
-#define CONFIGDIR      "/var/tuxbox/config/tuxwetter"
-#else
-#define        CONFIGDIR       "/var/bin/tuxwet"
+#ifndef FB_DEVICE
+#define FB_DEVICE      "/dev/fb/0"
+#endif
+#ifndef FB_DEVICE_FALLBACK
+#define FB_DEVICE_FALLBACK     "/dev/fb0"
 #endif
-#define MISS_FILE      CONFIGDIR "/missing_translations.txt"
+
+#ifndef CONFIGDIR
+#define CONFIGDIR "/var/tuxbox/config"
+#endif
+#ifndef FONTDIR
+#define FONTDIR        "/share/fonts"
+#endif
+#ifndef CFG_TUXWET
+#define CFG_TUXWET  CONFIGDIR "/tuxwetter"
+#endif
+#define MISS_FILE   CFG_TUXWET "/missing_translations.txt"
 
 //#define WWEATHER
 #define BUFSIZE        4095
@@ -168,7 +179,5 @@ int get_instance(void);
 void put_instance(int pval);
 int PaintWideString(int dy, const char *string, int sx, int sy, int maxwidth, int layout, int size, int color);
 
-#define FB_DEVICE      "/dev/fb/0"
-
 #endif