Unverified Commit d86bc138 authored by Cristian Maglie's avatar Cristian Maglie Committed by GitHub

[skip-changelog] Small change in upload message (#1991)

* Renamed variables

* Do not print full Port structure on messages

This produce a more clean output and stabilizes tests.
parent b1dd623e
...@@ -396,10 +396,10 @@ func runProgramAction(pme *packagemanager.Explorer, ...@@ -396,10 +396,10 @@ func runProgramAction(pme *packagemanager.Explorer,
} }
cb := &serialutils.ResetProgressCallbacks{ cb := &serialutils.ResetProgressCallbacks{
TouchingPort: func(port string) { TouchingPort: func(portAddress string) {
logrus.WithField("phase", "board reset").Infof("Performing 1200-bps touch reset on serial port %s", port) logrus.WithField("phase", "board reset").Infof("Performing 1200-bps touch reset on serial port %s", portAddress)
if verbose { if verbose {
outStream.Write([]byte(fmt.Sprintln(tr("Performing 1200-bps touch reset on serial port %s", port)))) outStream.Write([]byte(fmt.Sprintln(tr("Performing 1200-bps touch reset on serial port %s", portAddress))))
} }
}, },
WaitingForNewSerial: func() { WaitingForNewSerial: func() {
...@@ -408,17 +408,17 @@ func runProgramAction(pme *packagemanager.Explorer, ...@@ -408,17 +408,17 @@ func runProgramAction(pme *packagemanager.Explorer,
outStream.Write([]byte(fmt.Sprintln(tr("Waiting for upload port...")))) outStream.Write([]byte(fmt.Sprintln(tr("Waiting for upload port..."))))
} }
}, },
BootloaderPortFound: func(port string) { BootloaderPortFound: func(portAddress string) {
if port != "" { if portAddress != "" {
logrus.WithField("phase", "board reset").Infof("Upload port found on %s", port) logrus.WithField("phase", "board reset").Infof("Upload port found on %s", portAddress)
} else { } else {
logrus.WithField("phase", "board reset").Infof("No upload port found, using %s as fallback", actualPort) logrus.WithField("phase", "board reset").Infof("No upload port found, using %s as fallback", actualPort.Address)
} }
if verbose { if verbose {
if port != "" { if portAddress != "" {
outStream.Write([]byte(fmt.Sprintln(tr("Upload port found on %s", port)))) outStream.Write([]byte(fmt.Sprintln(tr("Upload port found on %s", portAddress))))
} else { } else {
outStream.Write([]byte(fmt.Sprintln(tr("No upload port found, using %s as fallback", actualPort)))) outStream.Write([]byte(fmt.Sprintln(tr("No upload port found, using %s as fallback", actualPort.Address))))
} }
} }
}, },
...@@ -427,11 +427,11 @@ func runProgramAction(pme *packagemanager.Explorer, ...@@ -427,11 +427,11 @@ func runProgramAction(pme *packagemanager.Explorer,
}, },
} }
if newPort, err := serialutils.Reset(portToTouch, wait, cb, dryRun); err != nil { if newPortAddress, err := serialutils.Reset(portToTouch, wait, cb, dryRun); err != nil {
outStream.Write([]byte(fmt.Sprintln(tr("Cannot perform port reset: %s", err)))) outStream.Write([]byte(fmt.Sprintln(tr("Cannot perform port reset: %s", err))))
} else { } else {
if newPort != "" { if newPortAddress != "" {
actualPort.Address = newPort actualPort.Address = newPortAddress
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment