summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Cruz <andre@cabine.org>2020-12-22 23:43:45 +0000
committerAndré Cruz <andre@cabine.org>2020-12-22 23:43:45 +0000
commit82f8e6f0add55914e4f0e15f1829e7d5daf6fcfe (patch)
tree12353ad416448108bbff14f803a51d3b2ba8da94
parente5dde3c700beab39fb941c6941e55535bf9b2af6 (diff)
Reset bytes sent each flash operation
When you drop a new firmware right after a previous flash operation the progress bar would not reset.
-rw-r--r--wally/dfu.go1
-rw-r--r--wally/teensy.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/wally/dfu.go b/wally/dfu.go
index bc8b7c5..2e6aa13 100644
--- a/wally/dfu.go
+++ b/wally/dfu.go
@@ -181,6 +181,7 @@ func DFUFlash(s *State) {
defer cfg.Close()
fileSize := len(firmwareData)
+ s.FlashProgress.Sent = 0
s.FlashProgress.Total = fileSize
err = dfuClearStatus(dev)
diff --git a/wally/teensy.go b/wally/teensy.go
index b63d1a4..534cab0 100644
--- a/wally/teensy.go
+++ b/wally/teensy.go
@@ -19,6 +19,7 @@ func TeensyFlash(s *State) {
}
defer file.Close()
+ s.FlashProgress.Sent = 0
s.FlashProgress.Total = ergodoxCodeSize
firmware := gohex.NewMemory()