Bring up nokia-sparkler SMP/cpufreq/lk2nd/cam/haptics, fix timer and EDL USB timeout
- Add 0013 early-SCM 4-core SMP + cpufreq kernel patch and clock-frequency DT nodes - Complete nokia-sparkler lk2nd port, boot/X11 session startup, 180-deg cached camera, and 157 Hz haptic audio - Replace root-only timer backend with permissionless sxmo_timer.sh and keypad/hook cancellation - Fix EDL Firehose rawmode ACK, USB active-config preservation, *+# hint, and 30 s default USB timeout - Sync a1120 (cocojamboo) prebuilts, docs, tests, and verified checksums in check-rebuild.sh
This commit is contained in:
1 parent
ab53423e33
commit
d7992904bf
56 files changed
+31850
-28281
No files matched your search
Vendored
+19
-7
@@ -1,6 +1,9 @@
|
||||
import usb.core # pyusb
|
||||
import usb.util
|
||||
|
||||
DEFAULT_USB_TIMEOUT_MS = 30000
|
||||
|
||||
|
||||
class usb_class():
|
||||
|
||||
def log(self,level,msg):
|
||||
@@ -10,10 +13,11 @@ class usb_class():
|
||||
else:
|
||||
print(msg)
|
||||
|
||||
def __init__(self,vid=0x05c6, pid=0x9008, Debug=False):
|
||||
def __init__(self,vid=0x05c6, pid=0x9008, Debug=False, timeout_ms=DEFAULT_USB_TIMEOUT_MS):
|
||||
self.vid=vid
|
||||
self.pid=pid
|
||||
self.debug=Debug
|
||||
self.timeout_ms=timeout_ms
|
||||
self.connected=False
|
||||
|
||||
def connect(self):
|
||||
@@ -28,8 +32,13 @@ class usb_class():
|
||||
except:
|
||||
pass
|
||||
|
||||
self.device.set_configuration()
|
||||
self.configuration = self.device.get_active_configuration()
|
||||
try:
|
||||
self.configuration = self.device.get_active_configuration()
|
||||
except usb.core.USBError:
|
||||
self.configuration = None
|
||||
if self.configuration is None:
|
||||
self.device.set_configuration()
|
||||
self.configuration = self.device.get_active_configuration()
|
||||
self.log(2, self.configuration)
|
||||
for itf_num in [0]:
|
||||
itf = usb.util.find_descriptor(self.configuration,
|
||||
@@ -56,20 +65,23 @@ class usb_class():
|
||||
lambda e: \
|
||||
usb.util.endpoint_direction(e.bEndpointAddress) == \
|
||||
usb.util.ENDPOINT_IN)
|
||||
self.device.default_timeout = self.timeout_ms
|
||||
self.connected=True
|
||||
return True
|
||||
|
||||
def write(self,command,pktsize=64):
|
||||
def write(self,command,pktsize=64,timeout=None):
|
||||
eff_timeout=self.timeout_ms if timeout is None else timeout
|
||||
pos=0
|
||||
if command==b'':
|
||||
self.device.write(self.EP_OUT, b'')
|
||||
self.device.write(self.EP_OUT, b'', eff_timeout)
|
||||
else:
|
||||
while pos<len(command):
|
||||
self.device.write(self.EP_OUT,command[pos:pos+pktsize])
|
||||
self.device.write(self.EP_OUT,command[pos:pos+pktsize],eff_timeout)
|
||||
pos+=pktsize
|
||||
|
||||
def read(self,length=0x80000,timeout=None):
|
||||
eff_timeout=self.timeout_ms if timeout is None else timeout
|
||||
tmp=b''
|
||||
while (bytearray(tmp) == b''):
|
||||
tmp=self.device.read(self.EP_IN, length,timeout)
|
||||
tmp=self.device.read(self.EP_IN, length, eff_timeout)
|
||||
return bytearray(tmp)
|
||||
Reference in new issue
Block a user