Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

fix #595 #797

Merged
merged 2 commits into from
Apr 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/arduino/arduino.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export class ArduinoApp {
if (!dc.sketch || !util.fileExistsSync(path.join(ArduinoWorkspace.rootPath, dc.sketch))) {
await this.getMainSketch(dc);
}
if (!dc.port) {

if ((!dc.configuration || !/upload_method=[^=,]*st[^,]*link/i.test(dc.configuration)) && !dc.port) {
const choice = await vscode.window.showInformationMessage(
"Serial port is not specified. Do you want to select a serial port for uploading?",
"Yes", "No");
Expand Down Expand Up @@ -140,7 +141,11 @@ export class ArduinoApp {
}

const appPath = path.join(ArduinoWorkspace.rootPath, dc.sketch);
const args = ["--upload", "--board", boardDescriptor, "--port", dc.port, appPath];
const args = ["--upload", "--board", boardDescriptor];
if (dc.port) {
args.push("--port", dc.port);
}
args.push(appPath);
if (VscodeSettings.getInstance().logLevel === "verbose") {
args.push("--verbose");
}
Expand Down