mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-10-14 13:58:31 +00:00
Fix upload and serial (#661)
* get serial connection status from BE * handle serial connect in the BE * allow breakpoints on vscode (windows) * Timeout on config change to prevent serial busy * serial-service tests
This commit is contained in:
@@ -210,7 +210,7 @@ export class UploadSketch extends SketchContribution {
|
||||
if (!sketch) {
|
||||
return;
|
||||
}
|
||||
await this.serialConnection.disconnect();
|
||||
|
||||
try {
|
||||
const { boardsConfig } = this.boardsServiceClientImpl;
|
||||
const [fqbn, { selectedProgrammer }, verify, verbose, sourceOverride] =
|
||||
@@ -288,27 +288,7 @@ export class UploadSketch extends SketchContribution {
|
||||
this.uploadInProgress = false;
|
||||
this.onDidChangeEmitter.fire();
|
||||
|
||||
if (
|
||||
this.serialConnection.isSerialOpen() &&
|
||||
this.serialConnection.serialConfig
|
||||
) {
|
||||
const { board, port } = this.serialConnection.serialConfig;
|
||||
try {
|
||||
await this.boardsServiceClientImpl.waitUntilAvailable(
|
||||
Object.assign(board, { port }),
|
||||
10_000
|
||||
);
|
||||
await this.serialConnection.connect();
|
||||
} catch (waitError) {
|
||||
this.messageService.error(
|
||||
nls.localize(
|
||||
'arduino/sketch/couldNotConnectToSerial',
|
||||
'Could not reconnect to serial port. {0}',
|
||||
waitError.toString()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
setTimeout(() => this.serialConnection.reconnectAfterUpload(), 5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user