From 78d340953656e595df59d55737486a91ca839535 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Mon, 1 Apr 2019 10:43:29 +0800 Subject: [PATCH] fix #595 --- src/arduino/arduino.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/arduino/arduino.ts b/src/arduino/arduino.ts index ad0fecac..8afcda10 100644 --- a/src/arduino/arduino.ts +++ b/src/arduino/arduino.ts @@ -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"); @@ -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"); }