forked from platformio/platformio-core
Hook when new serial port is the same in boot mode
This commit is contained in:
@ -48,7 +48,6 @@ def TouchSerialPort(env, port, baudrate):
|
|||||||
|
|
||||||
|
|
||||||
def WaitForNewSerialPort(env, before):
|
def WaitForNewSerialPort(env, before):
|
||||||
sleep(0.5)
|
|
||||||
new_port = None
|
new_port = None
|
||||||
elapsed = 0
|
elapsed = 0
|
||||||
while elapsed < 10:
|
while elapsed < 10:
|
||||||
@ -62,6 +61,9 @@ def WaitForNewSerialPort(env, before):
|
|||||||
sleep(0.25)
|
sleep(0.25)
|
||||||
elapsed += 0.25
|
elapsed += 0.25
|
||||||
|
|
||||||
|
if not new_port and env.subst("$UPLOAD_PORT") in now:
|
||||||
|
new_port = env.subst("$UPLOAD_PORT")
|
||||||
|
|
||||||
if not new_port:
|
if not new_port:
|
||||||
env.Exit("Error: Couldn't find a board on the selected port. "
|
env.Exit("Error: Couldn't find a board on the selected port. "
|
||||||
"Check that you have the correct port selected. "
|
"Check that you have the correct port selected. "
|
||||||
|
Reference in New Issue
Block a user