diff options
author | sago35 <[email protected]> | 2020-05-07 12:44:49 +0900 |
---|---|---|
committer | Ron Evans <[email protected]> | 2020-06-03 15:26:03 +0200 |
commit | 72064e12db1fda5f8ce348d112207f92100dd2f0 (patch) | |
tree | 7cc054f7304f2b7bac1c45793b81b80158422b7e | |
parent | 3c31a3110f7b91e738154e27198576951aa9290e (diff) | |
download | tinygo-72064e12db1fda5f8ce348d112207f92100dd2f0.tar.gz tinygo-72064e12db1fda5f8ce348d112207f92100dd2f0.zip |
WIP flash: fix touchSerialPortAt1200bps on windows
-rw-r--r-- | main.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 |