mirror of
https://github.com/bkerler/edl.git
synced 2024-11-14 19:14:58 -05:00
Windows vs. Linux
This commit is contained in:
parent
b4a0ed3cfd
commit
2a2342b27c
2 changed files with 9 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
import binascii
|
||||
import platform
|
||||
import time
|
||||
from Library.utils import *
|
||||
from Library.gpt import gpt
|
||||
|
@ -415,6 +416,7 @@ class qualcomm_firehose:
|
|||
v = b'-1'
|
||||
#try:
|
||||
if lvl!=1:
|
||||
if platform.system()=='Windows':
|
||||
self.cdc.timeout = 50
|
||||
info=[]
|
||||
while v != b'':
|
||||
|
@ -428,7 +430,7 @@ class qualcomm_firehose:
|
|||
if info=='':
|
||||
break
|
||||
except:
|
||||
pass
|
||||
break
|
||||
#if info==[]:
|
||||
# info=self.cmd_nop()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ from binascii import hexlify,unhexlify
|
|||
import usb.core # pyusb
|
||||
import usb.util
|
||||
import time
|
||||
import platform
|
||||
|
||||
USB_DIR_OUT=0 # to device
|
||||
USB_DIR_IN=0x80 # to host
|
||||
|
@ -160,7 +161,8 @@ class usb_class():
|
|||
try:
|
||||
tmp=self.device.read(self.EP_IN, length,timeout)
|
||||
except usb.core.USBError as e:
|
||||
if b"timed out" in e.strerror:
|
||||
if "timed out" in e.strerror:
|
||||
if platform.system()=='Windows':
|
||||
time.sleep(0.05)
|
||||
print("Waiting...")
|
||||
return bytearray(tmp)
|
||||
|
|
Loading…
Reference in a new issue