Skip to content

Commit 9b21d79

Browse files
author
Federico Fissore
committed
Passing builder VID and PID in order to trigger Genuino build.vid/pid overrides
Signed-off-by: Federico Fissore <[email protected]>
1 parent 2a885d2 commit 9b21d79

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.go

+7
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const FLAG_LOGGER_HUMAN = "human"
7171
const FLAG_LOGGER_MACHINE = "machine"
7272
const FLAG_LIB_DISCOVERY_RECURSION_PATH = "lib-discovery-recursion-depth"
7373
const FLAG_VERSION = "version"
74+
const FLAG_VID_PID = "vid-pid"
7475

7576
type slice []string
7677

@@ -110,6 +111,7 @@ var libraryDiscoveryRecursionDepthFlag *int
110111
var warningsLevelFlag *string
111112
var loggerFlag *string
112113
var versionFlag *bool
114+
var vidPidFlag *string
113115

114116
func init() {
115117
compileFlag = flag.Bool(FLAG_COMPILE, false, "compiles the given sketch")
@@ -128,6 +130,7 @@ func init() {
128130
loggerFlag = flag.String(FLAG_LOGGER, FLAG_LOGGER_HUMAN, "Sets type of logger. Available values are '"+FLAG_LOGGER_HUMAN+"', '"+FLAG_LOGGER_MACHINE+"'")
129131
libraryDiscoveryRecursionDepthFlag = flag.Int(FLAG_LIB_DISCOVERY_RECURSION_PATH, builder.DEFAULT_LIBRARY_DISCOVERY_RECURSION_DEPTH, "How deep should library discovery go down looking for included libraries")
130132
versionFlag = flag.Bool(FLAG_VERSION, false, "prints version and exits")
133+
vidPidFlag = flag.String(FLAG_VID_PID, "", "specify to use vid/pid specific build properties, as defined in boards.txt")
131134
}
132135

133136
func main() {
@@ -248,6 +251,10 @@ func main() {
248251
}
249252
context[constants.CTX_BUILD_PATH] = buildPath
250253

254+
if *vidPidFlag != "" {
255+
context[constants.CTX_VIDPID] = *vidPidFlag
256+
}
257+
251258
if compile && flag.NArg() == 0 {
252259
fmt.Fprintln(os.Stderr, "Last parameter must be the sketch to compile")
253260
flag.Usage()

0 commit comments

Comments
 (0)