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

Commit e68600e

Browse files
authored
fix #595 (#797)
* fix #595 * better match
1 parent b719777 commit e68600e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/arduino/arduino.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ export class ArduinoApp {
108108
if (!dc.sketch || !util.fileExistsSync(path.join(ArduinoWorkspace.rootPath, dc.sketch))) {
109109
await this.getMainSketch(dc);
110110
}
111-
if (!dc.port) {
111+
112+
if ((!dc.configuration || !/upload_method=[^=,]*st[^,]*link/i.test(dc.configuration)) && !dc.port) {
112113
const choice = await vscode.window.showInformationMessage(
113114
"Serial port is not specified. Do you want to select a serial port for uploading?",
114115
"Yes", "No");
@@ -140,7 +141,11 @@ export class ArduinoApp {
140141
}
141142

142143
const appPath = path.join(ArduinoWorkspace.rootPath, dc.sketch);
143-
const args = ["--upload", "--board", boardDescriptor, "--port", dc.port, appPath];
144+
const args = ["--upload", "--board", boardDescriptor];
145+
if (dc.port) {
146+
args.push("--port", dc.port);
147+
}
148+
args.push(appPath);
144149
if (VscodeSettings.getInstance().logLevel === "verbose") {
145150
args.push("--verbose");
146151
}

0 commit comments

Comments
 (0)