Skip to content

Commit 2167e45

Browse files
Get the profile's FQBN if it's not already specified in the request
1 parent 4d747c8 commit 2167e45

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
@@ -143,12 +143,17 @@ func Upload(ctx context.Context, req *rpc.UploadRequest, outStream io.Writer, er
143143
}
144144
defer pmeRelease()
145145

146+
fqbn := req.GetFqbn()
147+
if fqbn == "" && pme.GetProfile() != nil {
148+
fqbn = pme.GetProfile().FQBN
149+
}
150+
146151
updatedPort, err := runProgramAction(
147152
pme,
148153
sk,
149154
req.GetImportFile(),
150155
req.GetImportDir(),
151-
req.GetFqbn(),
156+
fqbn,
152157
req.GetPort(),
153158
req.GetProgrammer(),
154159
req.GetVerbose(),

0 commit comments

Comments
 (0)