WIP flash: fix touchSerialPortAt1200bps on windows

This commit is contained in:
sago35
2020-05-07 12:44:49 +09:00
committed by Ron Evans
parent 3c31a3110f
commit 72064e12db
+7
View File
@@ -479,6 +479,13 @@ func touchSerialPortAt1200bps(port string) (err error) {
// Open port
p, e := serial.Open(port, &serial.Mode{BaudRate: 1200})
if e != nil {
if runtime.GOOS == `windows` {
se, ok := e.(*serial.PortError)
if ok && se.Code() == serial.InvalidSerialPort {
// InvalidSerialPort error occurs when transitioning to boot
return nil
}
}
time.Sleep(1 * time.Second)
err = e
continue