mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-21 16:20:46 +00:00
increase intial sleep for port check, otherwise it ccould fail on pi4
This commit is contained in:
parent
83840041a8
commit
c1dbeb55b4
@ -65,13 +65,14 @@ def open_serial_dev(port):
|
||||
if os.path.exists(port):
|
||||
try:
|
||||
# slight delay since kernel may occupy the port briefly
|
||||
time.sleep(0.2)
|
||||
time.sleep(0.5)
|
||||
timeout = timeout - 0.5
|
||||
ser = serial.Serial(port, timeout=1)
|
||||
break
|
||||
except serial.SerialException:
|
||||
pass
|
||||
time.sleep(0.8)
|
||||
timeout = timeout - 1
|
||||
time.sleep(0.5)
|
||||
timeout = timeout - 0.5
|
||||
assert timeout, 'Device not available or Cannot open port'
|
||||
return ser
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user