Skip to content

Commit a251b9c

Browse files
committed
Allow user to specify fqbn in the commandline using the board parameter
1 parent 13c9b5d commit a251b9c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: upload/upload.go

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func PartiallyResolve(board, file, platformPath, commandline string, extra Extra
4646
commandline = strings.Replace(commandline, "{build.path}", filepath.ToSlash(filepath.Dir(file)), -1)
4747
commandline = strings.Replace(commandline, "{build.project_name}", strings.TrimSuffix(filepath.Base(file), filepath.Ext(filepath.Base(file))), -1)
4848
commandline = strings.Replace(commandline, "{runtime.platform.path}", filepath.ToSlash(platformPath), -1)
49+
commandline = strings.Replace(commandline, "{fqbn}", board, -1)
4950

5051
// search for runtime variables and replace with values from Locater
5152
var runtimeRe = regexp.MustCompile("\\{(.*?)\\}")

Diff for: upload/upload_test.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,14 @@ var TestResolveData = []struct {
6868
"",
6969
`{runtime.tools.avrdude.path}/bin/avrdude -C{runtime.tools.avrdude.path}/etc/avrdude.conf -v {upload.verify} -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"`,
7070
Extra{Use1200bpsTouch: true, WaitForUploadPort: true},
71-
`$loc$loc{runtime.tools.avrdude.path}/bin/avrdude -C{runtime.tools.avrdude.path}/etc/avrdude.conf -v $loc{upload.verify} -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D "-Uflash:w:./upload_test.hex:i"`,
71+
`$loc$loc{runtime.tools.avrdude.path}/bin/avrdude -C{runtime.tools.avrdude.path}/etc/avrdude.conf -v $loc{upload.verify} -patmega32u4 -cavr109 -P$loc{serial.port} -b57600 -D "-Uflash:w:./upload_test.hex:i"`,
72+
},
73+
{"arduino:renesas_uno:unor4wifi",
74+
"UpdateFirmware.bin",
75+
"",
76+
`{runtime.tools.arduino-fwuploader.path}/arduino-fwuploader firmware flash -a {serial.port} -b {fqbn} -v --retries 5"`,
77+
Extra{Use1200bpsTouch: true, WaitForUploadPort: true},
78+
`$loc{runtime.tools.arduino-fwuploader.path}/arduino-fwuploader firmware flash -a $loc{serial.port} -b arduino:renesas_uno:unor4wifi -v --retries 5"`,
7279
},
7380
}
7481

0 commit comments

Comments
 (0)