Explorar o código

Config file TFT

Ander %!s(int64=11) %!d(string=hai) anos
pai
achega
68a9e87131

+ 3 - 0
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):

+ 3 - 0
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

+ 3 - 4
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,