aboutsummaryrefslogtreecommitdiff
path: root/turtetris_master
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2017-07-18 14:00:59 +0200
committerKarel Kočí <karel.koci@nic.cz>2017-07-18 14:21:38 +0200
commit0a9a2fd752b03e1796ed6ce110ee939f0eb773e6 (patch)
tree9132846843c3eb164672f8a7f1661dd71307b12c /turtetris_master
parent5256ae2e59f513afe66203ceecd8759d1bd60a07 (diff)
downloadturris-tetris-0a9a2fd752b03e1796ed6ce110ee939f0eb773e6.tar.gz
turris-tetris-0a9a2fd752b03e1796ed6ce110ee939f0eb773e6.tar.bz2
turris-tetris-0a9a2fd752b03e1796ed6ce110ee939f0eb773e6.zip
Force libusb-1.0 backend
Diffstat (limited to 'turtetris_master')
-rw-r--r--turtetris_master/led_output.py0
-rw-r--r--turtetris_master/usb_input.py6
2 files changed, 5 insertions, 1 deletions
diff --git a/turtetris_master/led_output.py b/turtetris_master/led_output.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/turtetris_master/led_output.py
diff --git a/turtetris_master/usb_input.py b/turtetris_master/usb_input.py
index 8864ef9..0bb9d56 100644
--- a/turtetris_master/usb_input.py
+++ b/turtetris_master/usb_input.py
@@ -1,4 +1,5 @@
import usb.core
+import usb.backend.libusb1
import usb.util
# Personal Communication Systems, Inc. SNES Gamepad
@@ -14,8 +15,11 @@ class Gamepad:
def __init__(self, conf=CONF_SNES_GAMEPAD):
"Initializes usb subsystem"
+ backend = usb.backend.libusb1.get_backend(find_library=lambda x:
+ "/usr/lib/libusb-1.0.so")
self.dev = usb.core.find(idVendor=conf['idVendor'],
- idProduct=conf['idProduct'])
+ idProduct=conf['idProduct'],
+ backend=backend)
if self.dev is None:
raise ValueError('Device not found')