@@ -23,7 +23,7 @@ func (b *Bossac) Flash(ctx context.Context, filename string) error {
23
23
if err != nil {
24
24
return err
25
25
}
26
- err = invokeBossac ([]string {"-e" , "-R" , "-p" , port , "-w" , filename })
26
+ err = invokeBossac ([]string {ctx . ProgrammerPath , "-e" , "-R" , "-p" , port , "-w" , filename })
27
27
28
28
ports , err := serial .GetPortsList ()
29
29
port = waitReset (ports , port )
@@ -38,12 +38,12 @@ func (b *Bossac)DumpAndFlash(ctx context.Context, filename string) (string, erro
38
38
if err != nil {
39
39
return "" , err
40
40
}
41
- err = invokeBossac ([]string {"-u" , "-r" , "-p" , port , filepath .Join (dir , "dump.bin" )})
41
+ err = invokeBossac ([]string {ctx . ProgrammerPath , "-u" , "-r" , "-p" , port , filepath .Join (dir , "dump.bin" )})
42
42
log .Println ("Original sketch saved at " + filepath .Join (dir , "dump.bin" ))
43
43
if err != nil {
44
44
return "" , err
45
45
}
46
- err = invokeBossac ([]string {"-e" , "-R" , "-p" , port , "-w" , filename })
46
+ err = invokeBossac ([]string {ctx . ProgrammerPath , "-e" , "-R" , "-p" , port , "-w" , filename })
47
47
48
48
ports , err := serial .GetPortsList ()
49
49
port = waitReset (ports , port )
@@ -52,7 +52,7 @@ func (b *Bossac)DumpAndFlash(ctx context.Context, filename string) (string, erro
52
52
}
53
53
54
54
func invokeBossac (args []string ) error {
55
- cmd := exec .Command ("bossac/bossac" , args ... )
55
+ cmd := exec .Command (args [ 0 ] , args [ 1 :] ... )
56
56
var out bytes.Buffer
57
57
cmd .Stdout = & out
58
58
err := cmd .Run ()
0 commit comments