Skip to content

Commit 96a73e6

Browse files
committed
Close flasher after completing operations
1 parent 19b5f15 commit 96a73e6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: modules/nina/main.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,16 @@ func Run(ctx context.Context) {
111111
}
112112
}
113113

114-
if ctx.BinaryToRestore != "" {
115-
f.Close()
114+
f.Close()
116115

116+
if ctx.BinaryToRestore != "" {
117117
log.Println("Restoring previous sketch")
118118
if programmer == nil {
119119
log.Fatal("ERROR: You must specify a programmer!")
120120
}
121121
if err := programmer.Flash(&ctx, ctx.BinaryToRestore); err != nil {
122122
log.Fatal(err)
123123
}
124-
125-
// just to allow cleanup via defer()
126-
// f.port, _ = OpenSerial(ctx.PortName)
127124
}
128125
}
129126

0 commit comments

Comments
 (0)