Skip to content

Commit b9ffc31

Browse files
Get the profile's FQBN if it's not already specified in the request
1 parent 2ead5ec commit b9ffc31

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Diff for: commands/compile/compile.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
8181

8282
fqbnIn := req.GetFqbn()
8383
if fqbnIn == "" && sk != nil {
84-
fqbnIn = sk.GetDefaultFQBN()
84+
if pme.GetProfile() != nil {
85+
fqbnIn = pme.GetProfile().FQBN
86+
} else {
87+
fqbnIn = sk.GetDefaultFQBN()
88+
}
8589
}
8690
if fqbnIn == "" {
8791
return nil, &arduino.MissingFQBNError{}

Diff for: commands/upload/upload.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,17 @@ func Upload(ctx context.Context, req *rpc.UploadRequest, outStream io.Writer, er
140140
}
141141
defer release()
142142

143+
fqbn := req.GetFqbn()
144+
if fqbn == "" && pme.GetProfile() != nil {
145+
fqbn = pme.GetProfile().FQBN
146+
}
147+
143148
if err := runProgramAction(
144149
pme,
145150
sk,
146151
req.GetImportFile(),
147152
req.GetImportDir(),
148-
req.GetFqbn(),
153+
fqbn,
149154
req.GetPort(),
150155
req.GetProgrammer(),
151156
req.GetVerbose(),

0 commit comments

Comments
 (0)