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

Commit

Permalink
fix #595
Browse files Browse the repository at this point in the history
  • Loading branch information
Sneezry committed Apr 1, 2019
1 parent b719777 commit 78d3409
Showing 1 changed file with 7 additions and 2 deletions.
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 || dc.configuration.indexOf("upload_method=STLink") === -1) && !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

0 comments on commit 78d3409

Please sign in to comment.