From 00b08b4737176cf653cd70967d06149b386d9667 Mon Sep 17 00:00:00 2001 From: Andreas Hagmann Date: Sun, 17 Nov 2013 01:20:29 +0100 Subject: fix config and startup --- gamepad.c | 14 ++++---------- gamepad_handler_thread.c | 3 ++- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/gamepad.c b/gamepad.c index 9b7aac9..672ab2f 100755 --- a/gamepad.c +++ b/gamepad.c @@ -29,7 +29,6 @@ public: virtual void MainThreadHook(void); virtual cString Active(void); virtual time_t WakeupTime(void); - //virtual const char *MainMenuEntry(void) { return MAINMENUENTRY; } virtual cOsdObject *MainMenuAction(void); virtual cMenuSetupPage *SetupMenu(void); virtual bool SetupParse(const char *Name, const char *Value); @@ -40,9 +39,7 @@ public: cPluginGamepad::cPluginGamepad(void) : processKeysThread(NULL) { - // Initialize any member variables here. - // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL - // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! + } cPluginGamepad::~cPluginGamepad() @@ -71,12 +68,9 @@ bool cPluginGamepad::Initialize(void) bool cPluginGamepad::Start(void) { - if (processKeysThread == NULL) - { - bool ret; - ret = processKeysThread->Start(); - dsyslog("[gamepad] start handler returned %d", ret); - } + bool ret; + ret = processKeysThread->Start(); + dsyslog("[gamepad] start handler returned %d", ret); return true; } diff --git a/gamepad_handler_thread.c b/gamepad_handler_thread.c index b43d76c..76f4eca 100755 --- a/gamepad_handler_thread.c +++ b/gamepad_handler_thread.c @@ -8,6 +8,7 @@ #include "gamepad_handler_thread.h" #include #include +#include "gamepad_config.h" cGamepadHandlerThread::cGamepadHandlerThread(cEventFifo *_fifo) : cThread("gamepad_handler") { @@ -17,7 +18,7 @@ cGamepadHandlerThread::cGamepadHandlerThread(cEventFifo *_fifo) : cThread("gamep void cGamepadHandlerThread::Action() { cGamepadHandler gamepad; - gamepad.connect("/dev/input/js2"); + gamepad.connect(gamepadConfig.device); if (gamepad.ready()) { -- cgit v1.2.3