mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-23 04:20:47 +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):
|
if os.path.exists(port):
|
||||||
try:
|
try:
|
||||||
# slight delay since kernel may occupy the port briefly
|
# 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)
|
ser = serial.Serial(port, timeout=1)
|
||||||
break
|
break
|
||||||
except serial.SerialException:
|
except serial.SerialException:
|
||||||
pass
|
pass
|
||||||
time.sleep(0.8)
|
time.sleep(0.5)
|
||||||
timeout = timeout - 1
|
timeout = timeout - 0.5
|
||||||
assert timeout, 'Device not available or Cannot open port'
|
assert timeout, 'Device not available or Cannot open port'
|
||||||
return ser
|
return ser
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user