m1n1.proxyutils: Only set baud if connected via serial

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-09-19 22:32:58 +09:00
parent 99e38d24d0
commit 6c070fa224

View file

@ -442,12 +442,18 @@ class GuardedHeap:
def bootstrap_port(iface, proxy):
to = iface.dev.timeout
do_baud = True
try:
iface.dev.timeout = 0.15
iface.nop()
proxy.set_baud(1500000)
except UartTimeout:
iface.dev.baudrate = 1500000
do_baud = proxy.iodev_whoami() == IODEV.UART
except ProxyCommandError:
pass
if do_baud:
try:
iface.dev.timeout = 0.15
iface.nop()
proxy.set_baud(1500000)
except UartTimeout:
iface.dev.baudrate = 1500000
iface.nop()
iface.dev.timeout = to