File tree 4 files changed +12
-9
lines changed
4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,6 @@ func run(cmd *cobra.Command, args []string) {
171
171
// Flash loader Sketch
172
172
programmerOut := new (bytes.Buffer )
173
173
programmerErr := new (bytes.Buffer )
174
- // var err error
175
174
if feedback .GetFormat () == feedback .JSON {
176
175
err = programmer .Flash (commandLine , programmerOut , programmerErr )
177
176
} else {
Original file line number Diff line number Diff line change @@ -86,13 +86,12 @@ func (f *NinaFlasher) FlashFirmware(firmwareFile *paths.Path) error {
86
86
}
87
87
88
88
logrus .Debugf ("Checking md5" )
89
- err = f .md5sum (data )
90
- if err != nil {
89
+ if err := f .md5sum (data ); err != nil {
91
90
logrus .Error (err )
92
91
return err
93
92
}
94
- logrus .Debugf ("Flashed all the things" )
95
- return nil
93
+ logrus .Infof ("Flashed all the things" )
94
+ return err //should be nil
96
95
}
97
96
98
97
func (f * NinaFlasher ) FlashCertificates (certificatePaths * paths.PathList , URLs []string ) error {
Original file line number Diff line number Diff line change @@ -101,7 +101,8 @@ func (f *SaraFlasher) FlashFirmware(firmwareFile *paths.Path) error {
101
101
if err != nil {
102
102
logrus .Error (err )
103
103
}
104
- return err
104
+ logrus .Infof ("Flashed all the things" )
105
+ return err //should be nil
105
106
}
106
107
107
108
func (f * SaraFlasher ) FlashCertificates (certificatePaths * paths.PathList , URLs []string ) error {
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ import (
27
27
"encoding/binary"
28
28
"errors"
29
29
"fmt"
30
- "log"
31
30
"strconv"
32
31
"time"
33
32
@@ -68,7 +67,12 @@ func (f *WincFlasher) FlashFirmware(firmwareFile *paths.Path) error {
68
67
return err
69
68
}
70
69
firmwareOffset := 0x0000
71
- return f .flashChunk (firmwareOffset , data )
70
+ if err = f .flashChunk (firmwareOffset , data ); err != nil {
71
+ logrus .Error (err )
72
+ return err
73
+ }
74
+ logrus .Infof ("Flashed all the things" )
75
+ return err //should be nil
72
76
}
73
77
74
78
func (f * WincFlasher ) FlashCertificates (certificatePaths * paths.PathList , URLs []string ) error {
@@ -431,7 +435,7 @@ func (f *WincFlasher) erase(address uint32, length uint32) error {
431
435
return err
432
436
}
433
437
434
- log . Printf ("Erasing %d bytes from address 0x%X\n " , length , address )
438
+ logrus . Debugf ("Erasing %d bytes from address 0x%X\n " , length , address )
435
439
436
440
// wait acknowledge
437
441
ack := make ([]byte , 2 )
You can’t perform that action at this time.
0 commit comments