fix problem on startup
This commit is contained in:
parent
a636d8020e
commit
88a10882f2
@ -52,7 +52,7 @@ class fenrirManager():
|
|||||||
self.environment['runtime']['eventManager'].startMainEventLoop()
|
self.environment['runtime']['eventManager'].startMainEventLoop()
|
||||||
self.shutdown()
|
self.shutdown()
|
||||||
def handleInput(self, event):
|
def handleInput(self, event):
|
||||||
#startTime = time.time
|
#startTime = time.time()
|
||||||
self.environment['runtime']['debug'].writeDebugOut('DEBUG INPUT fenrirMan:' + str(event),debug.debugLevel.INFO)
|
self.environment['runtime']['debug'].writeDebugOut('DEBUG INPUT fenrirMan:' + str(event),debug.debugLevel.INFO)
|
||||||
if not event['Data']:
|
if not event['Data']:
|
||||||
event['Data'] = self.environment['runtime']['inputManager'].getInputEvent()
|
event['Data'] = self.environment['runtime']['inputManager'].getInputEvent()
|
||||||
|
@ -60,17 +60,19 @@ class driver(inputDriver):
|
|||||||
def plugInputDeviceWatchdogUdev(self,active , eventQueue):
|
def plugInputDeviceWatchdogUdev(self,active , eventQueue):
|
||||||
context = pyudev.Context()
|
context = pyudev.Context()
|
||||||
monitor = pyudev.Monitor.from_netlink(context)
|
monitor = pyudev.Monitor.from_netlink(context)
|
||||||
monitor.filter_by(subsystem='input')
|
monitor.filter_by(subsystem='input')
|
||||||
|
# wait until start process finished
|
||||||
|
time.sleep(8)
|
||||||
monitor.start()
|
monitor.start()
|
||||||
while active.value:
|
while active.value:
|
||||||
devices = monitor.poll(2)
|
devices = monitor.poll(2)
|
||||||
if devices:
|
if devices:
|
||||||
while monitor.poll(0.5):
|
while monitor.poll(0.2):
|
||||||
time.sleep(0.2)
|
time.sleep(0.1)
|
||||||
eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None})
|
eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None})
|
||||||
return time.time()
|
return time.time()
|
||||||
def plugInputDeviceWatchdogTimer(self, active):
|
def plugInputDeviceWatchdogTimer(self, active):
|
||||||
time.sleep(2.5)
|
time.sleep(10)
|
||||||
return time.time()
|
return time.time()
|
||||||
|
|
||||||
def inputWatchdog(self,active , eventQueue):
|
def inputWatchdog(self,active , eventQueue):
|
||||||
|
Loading…
Reference in New Issue
Block a user