Skip to content

Commit f5b4125

Browse files
authored
[skip-changelog] fixed verbose '1200-bps touch' notice (arduino#726)
Previously, if there were many serial port connected, multiple Performing 1200-bps touch reset on serial port /dev/ttyACMxx were printed due to misplacement of the verbose print.
1 parent 8220b32 commit f5b4125

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

commands/upload/upload.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ func Upload(ctx context.Context, req *rpc.UploadReq, outStream io.Writer, errStr
172172
return nil, fmt.Errorf("cannot get serial port list: %s", err)
173173
}
174174
for _, p := range ports {
175-
if req.GetVerbose() {
176-
outStream.Write([]byte(fmt.Sprintf("Performing 1200-bps touch reset on serial port %s", p)))
177-
outStream.Write([]byte(fmt.Sprintln()))
178-
}
179175
if p == port {
176+
if req.GetVerbose() {
177+
outStream.Write([]byte(fmt.Sprintf("Performing 1200-bps touch reset on serial port %s", p)))
178+
outStream.Write([]byte(fmt.Sprintln()))
179+
}
180180
if err := touchSerialPortAt1200bps(p); err != nil {
181181
return nil, fmt.Errorf("cannot perform reset: %s", err)
182182
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy