Config file TFT

This commit is contained in:
Ander
2014-11-19 23:32:49 +01:00
parent fb1fc96baf
commit 68a9e87131
3 changed files with 9 additions and 4 deletions

View File

@@ -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):

View File

@@ -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

View File

@@ -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,