File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ package certificates
21
21
22
22
import (
23
23
"bytes"
24
+ "fmt"
24
25
"os"
25
26
"path/filepath"
26
27
"strings"
@@ -161,13 +162,16 @@ func run(cmd *cobra.Command, args []string) {
161
162
162
163
// Get flasher depending on which module to use
163
164
var f flasher.Flasher
164
- switch board .Module {
165
+ moduleName := board .Module
166
+ switch moduleName {
165
167
case "NINA" :
166
168
f , err = flasher .NewNinaFlasher (address )
167
169
case "SARA" :
168
170
f , err = flasher .NewSaraFlasher (address )
169
- case "WINC " :
171
+ case "WINC1500 " :
170
172
f , err = flasher .NewWincFlasher (address )
173
+ default :
174
+ err = fmt .Errorf ("unknown module: %s" , moduleName )
171
175
}
172
176
if err != nil {
173
177
feedback .Errorf ("Error during certificates flashing: %s" , err )
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ package firmware
21
21
22
22
import (
23
23
"bytes"
24
+ "fmt"
24
25
"os"
25
26
"path/filepath"
26
27
"strings"
@@ -193,8 +194,10 @@ func run(cmd *cobra.Command, args []string) {
193
194
f , err = flasher .NewNinaFlasher (address )
194
195
case "SARA" :
195
196
f , err = flasher .NewSaraFlasher (address )
196
- case "WINC " :
197
+ case "WINC1500 " :
197
198
f , err = flasher .NewWincFlasher (address )
199
+ default :
200
+ err = fmt .Errorf ("unknown module: %s" , moduleName )
198
201
}
199
202
if err != nil {
200
203
feedback .Errorf ("Error during firmware flashing: %s" , err )
You can’t perform that action at this time.
0 commit comments