fix devcie detection
This commit is contained in:
parent
aa1fc75e5c
commit
a427ccd130
@ -44,7 +44,7 @@ class eventManager():
|
||||
elif event['Type'] == fenrirEventType.BrailleInput:
|
||||
pass
|
||||
elif event['Type'] == fenrirEventType.PlugInputDevice:
|
||||
#self.env['runtime']['fenrirManager'].handlePlugInputDevice(event)
|
||||
self.env['runtime']['fenrirManager'].handlePlugInputDevice(event)
|
||||
pass
|
||||
elif event['Type'] == fenrirEventType.BrailleFlush:
|
||||
pass
|
||||
|
@ -64,6 +64,8 @@ class driver():
|
||||
while active.value == 1:
|
||||
devices = monitor.poll(2)
|
||||
if devices:
|
||||
while monitor.poll(0.05):
|
||||
time.sleep(0.01)
|
||||
eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None})
|
||||
return time.time()
|
||||
def plugInputDeviceWatchdogTimer(self, active):
|
||||
@ -82,8 +84,7 @@ class driver():
|
||||
while r == []:
|
||||
if active.value == 0:
|
||||
return
|
||||
deviceFd = list(params['dev'])
|
||||
r, w, x = select(deviceFd, [], [], 2)
|
||||
r, w, x = select(list(params['dev']), [], [], 0.3)
|
||||
self.watchDog.value = 0
|
||||
except:
|
||||
pass
|
||||
@ -145,7 +146,6 @@ class driver():
|
||||
return
|
||||
uDevice.write_event(event)
|
||||
uDevice.syn()
|
||||
time.sleep(0.00001)
|
||||
|
||||
def updateInputDevices(self, force = False, init = False):
|
||||
if init:
|
||||
@ -202,6 +202,7 @@ class driver():
|
||||
self.env['runtime']['debug'].writeDebugOut("Skip Inputdevice : " + deviceFile +' ' + str(e),debug.debugLevel.ERROR)
|
||||
self.iDeviceNo = len(evdev.list_devices())
|
||||
self.updateMPiDevicesFD()
|
||||
print(list(self.iDevicesFD))
|
||||
def updateMPiDevicesFD(self):
|
||||
for fd in self.iDevices:
|
||||
if not fd in self.iDevicesFD:
|
||||
|
Loading…
Reference in New Issue
Block a user