@@ -85,7 +85,7 @@ export async function activate(context: vscode.ExtensionContext) {
85
85
}
86
86
87
87
if ( ! SerialMonitor . getInstance ( ) . initialized ) {
88
- SerialMonitor . getInstance ( ) . initialize ( ) ;
88
+ SerialMonitor . getInstance ( ) . initialize ( context ) ;
89
89
}
90
90
91
91
const arduinoPath = arduinoContextModule . default . arduinoApp . settings . arduinoPath ;
@@ -106,7 +106,7 @@ export async function activate(context: vscode.ExtensionContext) {
106
106
const registerNonArduinoCommand = ( command : string , commandBody : ( ...args : any [ ] ) => any , getUserData ?: ( ) => any ) : number => {
107
107
return context . subscriptions . push ( vscode . commands . registerCommand ( command , async ( ...args : any [ ] ) => {
108
108
if ( ! SerialMonitor . getInstance ( ) . initialized ) {
109
- SerialMonitor . getInstance ( ) . initialize ( ) ;
109
+ SerialMonitor . getInstance ( ) . initialize ( context ) ;
110
110
}
111
111
await commandExecution ( command , commandBody , args , getUserData ) ;
112
112
} ) ) ;
@@ -281,12 +281,12 @@ export async function activate(context: vscode.ExtensionContext) {
281
281
// serial monitor commands
282
282
const serialMonitor = SerialMonitor . getInstance ( ) ;
283
283
context . subscriptions . push ( serialMonitor ) ;
284
- registerNonArduinoCommand ( "arduino.selectSerialPort" , ( ) => serialMonitor . selectSerialPort ( null , null ) ) ;
284
+ registerNonArduinoCommand ( "arduino.selectSerialPort" , ( ) => serialMonitor . selectSerialPort ( ) ) ;
285
285
registerNonArduinoCommand ( "arduino.openSerialMonitor" , ( ) => serialMonitor . openSerialMonitor ( ) ) ;
286
- registerNonArduinoCommand ( "arduino.changeBaudRate" , ( ) => serialMonitor . changeBaudRate ( ) ) ;
287
- registerNonArduinoCommand ( "arduino.changeTimestampFormat" , ( ) => serialMonitor . changeTimestampFormat ( ) ) ;
288
- registerNonArduinoCommand ( "arduino.sendMessageToSerialPort" , ( ) => serialMonitor . sendMessageToSerialPort ( ) ) ;
289
- registerNonArduinoCommand ( "arduino.closeSerialMonitor" , ( port , showWarning = true ) => serialMonitor . closeSerialMonitor ( port , showWarning ) ) ;
286
+ // registerNonArduinoCommand("arduino.changeBaudRate", () => serialMonitor.changeBaudRate());
287
+ // registerNonArduinoCommand("arduino.changeTimestampFormat", () => serialMonitor.changeTimestampFormat());
288
+ // registerNonArduinoCommand("arduino.sendMessageToSerialPort", () => serialMonitor.sendMessageToSerialPort());
289
+ registerNonArduinoCommand ( "arduino.closeSerialMonitor" , ( port ) => serialMonitor . closeSerialMonitor ( port ) ) ;
290
290
291
291
const completionProvider = new completionProviderModule . CompletionProvider ( ) ;
292
292
context . subscriptions . push ( vscode . languages . registerCompletionItemProvider ( ARDUINO_MODE , completionProvider , "<" , '"' , "." ) ) ;
@@ -302,7 +302,7 @@ export async function activate(context: vscode.ExtensionContext) {
302
302
}
303
303
304
304
if ( ! SerialMonitor . getInstance ( ) . initialized ) {
305
- SerialMonitor . getInstance ( ) . initialize ( ) ;
305
+ SerialMonitor . getInstance ( ) . initialize ( context ) ;
306
306
}
307
307
vscode . commands . executeCommand ( "setContext" , "vscode-arduino:showExampleExplorer" , true ) ;
308
308
} ) ( ) ;
@@ -317,7 +317,7 @@ export async function activate(context: vscode.ExtensionContext) {
317
317
await arduinoActivatorModule . default . activate ( ) ;
318
318
}
319
319
if ( ! SerialMonitor . getInstance ( ) . initialized ) {
320
- SerialMonitor . getInstance ( ) . initialize ( ) ;
320
+ SerialMonitor . getInstance ( ) . initialize ( context ) ;
321
321
}
322
322
vscode . commands . executeCommand ( "setContext" , "vscode-arduino:showExampleExplorer" , true ) ;
323
323
}
@@ -411,14 +411,14 @@ export async function activate(context: vscode.ExtensionContext) {
411
411
412
412
setTimeout ( ( ) => {
413
413
// delay to detect usb
414
- usbDetectorModule . UsbDetector . getInstance ( ) . initialize ( context . extensionPath ) ;
414
+ usbDetectorModule . UsbDetector . getInstance ( ) . initialize ( context ) ;
415
415
usbDetectorModule . UsbDetector . getInstance ( ) . startListening ( ) ;
416
416
} , 200 ) ;
417
417
}
418
418
419
419
export async function deactivate ( ) {
420
420
const monitor = SerialMonitor . getInstance ( ) ;
421
- await monitor . closeSerialMonitor ( null , false ) ;
421
+ await monitor . closeSerialMonitor ( null ) ;
422
422
usbDetectorModule . UsbDetector . getInstance ( ) . stopListening ( ) ;
423
423
Logger . traceUserData ( "deactivate-extension" ) ;
424
424
}
0 commit comments