From 68a9e871318d804fb12a521b6a5314186a2ae26e Mon Sep 17 00:00:00 2001 From: Ander <9and3r@gmail.com> Date: Wed, 19 Nov 2014 23:32:49 +0100 Subject: [PATCH] Config file TFT --- mopidy_touchscreen/__init__.py | 3 +++ mopidy_touchscreen/ext.conf | 3 +++ mopidy_touchscreen/touch_screen.py | 7 +++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mopidy_touchscreen/__init__.py b/mopidy_touchscreen/__init__.py index 0a469e7..8cc146e 100644 --- a/mopidy_touchscreen/__init__.py +++ b/mopidy_touchscreen/__init__.py @@ -37,6 +37,9 @@ class Extension(ext.Extension): schema['gpio_up'] = config.Integer() schema['gpio_down'] = config.Integer() schema['gpio_enter'] = config.Integer() + schema['sdl_fbdev'] = config.String() + schema['sdl_mousdrv'] = config.String() + schema['sdl_mousedev'] = config.String() return schema def setup(self, registry): diff --git a/mopidy_touchscreen/ext.conf b/mopidy_touchscreen/ext.conf index 97165cb..dd9afd8 100644 --- a/mopidy_touchscreen/ext.conf +++ b/mopidy_touchscreen/ext.conf @@ -11,3 +11,6 @@ gpio_right = 27 gpio_up = 22 gpio_down = 23 gpio_enter = 24 +sdl_fbdev = /dev/fb1 +sdl_mousdrv = TSLIB +sdl_mousedev = event0 diff --git a/mopidy_touchscreen/touch_screen.py b/mopidy_touchscreen/touch_screen.py index 901487e..79deb44 100644 --- a/mopidy_touchscreen/touch_screen.py +++ b/mopidy_touchscreen/touch_screen.py @@ -23,10 +23,9 @@ class TouchScreen(pykka.ThreadingActor, core.CoreListener): config['touchscreen']['screen_height']) self.cache_dir = config['touchscreen']['cache_dir'] self.fullscreen = config['touchscreen']['fullscreen'] - os.environ["SDL_FBDEV"] = "/dev/fb1" - os.environ["SDL_MOUSEDEV"] = "/dev/input/touchscreen" - os.environ["TSLIB TSDEVICE"] = "/dev/input/eventX" - os.environ["SDL_MOUSEDRV"] = "TSLIB" + os.environ["SDL_FBDEV"] = config['touchscreen']['sdl_fbdev'] + os.environ["SDL_MOUSEDRV"] = config['touchscreen']['sdl_mousdrv'] + os.environ["SDL_MOUSEDEV"] = config['touchscreen']['sdl_mousedev'] pygame.init() self.cursor = config['touchscreen']['cursor'] self.screen_manager = ScreenManager(self.screen_size, self.core,