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

Commit bb0bcd4

Browse files
remove unused code and update api dependency
1 parent 94deda9 commit bb0bcd4

File tree

8 files changed

+8
-217
lines changed

8 files changed

+8
-217
lines changed

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ This extension provides several commands in the Command Palette (<kbd>F1</kbd> o
8181
| `arduino.enableUSBDetection` | Enable/disable USB detection from the VSCode Arduino extension. The default value is `true`. When your device is plugged in to your computer, it will pop up a message "`Detected board ****, Would you like to switch to this board type`". After clicking the `Yes` button, it will automatically detect which serial port (COM) is connected a USB device. If your device does not support this feature, please provide us with the PID/VID of your device; the code format is defined in `misc/usbmapping.json`.To learn more about how to list the vid/pid, use the following tools: https://github.com/EmergingTechnologyAdvisors/node-serialport `npm install -g serialport` `serialport-list -f jsonline`|
8282
| `arduino.disableTestingOpen` | Enable/disable automatic sending of a test message to the serial port for checking the open status. The default value is `false` (a test message will be sent). |
8383
| `arduino.skipHeaderProvider` | Enable/disable the extension providing completion items for headers. This functionality is included in newer versions of the C++ extension. The default value is `false`.|
84-
| `arduino.defaultBaudRate` | Default baud rate for the serial port monitor. The default value is 115200. Supported values are 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 74880, 115200, 230400 and 250000 |
8584
| `arduino.defaultTimestampFormat` | Format of timestamp printed before each line of Serial Monitor output. You can find list of all available placeholders [here](https://github.com/samsonjs/strftime#supported-specifiers). |
8685
| `arduino.disableIntelliSenseAutoGen` | When `true` vscode-arduino will not auto-generate an IntelliSense configuration (i.e. `.vscode/c_cpp_properties.json`) by analyzing Arduino's compiler output. |
8786
| `arduino.analyzeOnOpen` | When true, automatically run analysis when the project is opened. Only works when `arduino.analyzeOnSettingChange` is true. |
@@ -102,7 +101,6 @@ The following Visual Studio Code settings are available for the Arduino extensio
102101
"https://raw.githubusercontent.com/VSChina/azureiotdevkit_tools/master/package_azureboard_index.json",
103102
"http://arduino.esp8266.com/stable/package_esp8266com_index.json"
104103
],
105-
"arduino.defaultBaudRate": 115200
106104
}
107105
```
108106
*Note:* You only need to set `arduino.path` in Visual Studio Code settings, other options are not required.

package-lock.json

+7-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-21
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@
4242
"onCommand:arduino.selectProgrammer",
4343
"onCommand:arduino.selectSerialPort",
4444
"onCommand:arduino.selectSketch",
45-
"onCommand:arduino.changeBaudRate",
46-
"onCommand:arduino.changeTimestampFormat",
4745
"onCommand:arduino.openSerialMonitor",
48-
"onCommand:arduino.sendMessageToSerialPort",
4946
"onCommand:arduino.closeSerialMonitor",
5047
"onCommand:arduino.changeBoardType",
5148
"onCommand:arduino.showBoardConfig",
@@ -124,14 +121,6 @@
124121
"command": "arduino.selectSerialPort",
125122
"title": "Arduino: Select Serial Port"
126123
},
127-
{
128-
"command": "arduino.changeBaudRate",
129-
"title": "Arduino: Change Baud Rate"
130-
},
131-
{
132-
"command": "arduino.changeTimestampFormat",
133-
"title": "Arduino: Change Timestamp Format"
134-
},
135124
{
136125
"command": "arduino.openSerialMonitor",
137126
"title": "Arduino: Open Serial Monitor"
@@ -527,20 +516,11 @@
527516
"type": "boolean",
528517
"default": false
529518
},
530-
"arduino.defaultBaudRate": {
531-
"type": "number",
532-
"default": 115200
533-
},
534519
"arduino.disableIntelliSenseAutoGen": {
535520
"type": "boolean",
536521
"default": false,
537522
"description": "When disabled vscode-arduino will not auto-generate an IntelliSense configuration (i.e. c_cpp_properties.json) by analyzing the compiler output."
538523
},
539-
"arduino.defaultTimestampFormat": {
540-
"type": "string",
541-
"default": "",
542-
"markdownDescription": "Format of timestamp printed before each line of Serial Monitor output. You can find list of all available placeholders [here](https://github.com/samsonjs/strftime#supported-specifiers)."
543-
},
544524
"arduino.analyzeOnOpen": {
545525
"type": "boolean",
546526
"default": true,
@@ -604,7 +584,6 @@
604584
"ms-vscode.vscode-serial-monitor"
605585
],
606586
"devDependencies": {
607-
"@microsoft/vscode-serial-monitor-api": "0.1.3",
608587
"@babel/core": "^7.15.5",
609588
"@babel/preset-env": "^7.15.6",
610589
"@types/compare-versions": "^3.0.0",
@@ -648,6 +627,7 @@
648627
"webpack": "^4.44.1"
649628
},
650629
"dependencies": {
630+
"@microsoft/vscode-serial-monitor-api": "^0.1.4",
651631
"@vscode/extension-telemetry": "~0.6.2",
652632
"body-parser": "^1.16.1",
653633
"cocopa": "0.0.13",

src/arduino/arduinoSettings.ts

-35
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ export interface IArduinoSettings {
1919
defaultLibPath: string;
2020
sketchbookPath: string;
2121
preferencePath: string;
22-
defaultBaudRate: number;
2322
preferences: Map<string, string>;
2423
useArduinoCli: boolean;
25-
defaultTimestampFormat: string;
2624
analyzeOnSettingChange: boolean;
2725
reloadPreferences(): void;
2826
}
@@ -36,14 +34,10 @@ export class ArduinoSettings implements IArduinoSettings {
3634

3735
private _sketchbookPath: string;
3836

39-
private _defaultBaudRate: number;
40-
4137
private _preferences: Map<string, string>;
4238

4339
private _useArduinoCli: boolean;
4440

45-
private _defaultTimestampFormat: string;
46-
4741
public constructor() {
4842
}
4943

@@ -52,8 +46,6 @@ export class ArduinoSettings implements IArduinoSettings {
5246
this._commandPath = VscodeSettings.getInstance().commandPath;
5347
this._useArduinoCli = VscodeSettings.getInstance().useArduinoCli;
5448
await this.tryResolveArduinoPath();
55-
await this.tryGetDefaultBaudRate();
56-
await this.tryGetDefaultTimestampFormat();
5749
if (platform === "win32") {
5850
await this.updateWindowsPath();
5951
if (this._commandPath === "") {
@@ -162,14 +154,6 @@ export class ArduinoSettings implements IArduinoSettings {
162154
return this._useArduinoCli;
163155
}
164156

165-
public get defaultBaudRate() {
166-
return this._defaultBaudRate;
167-
}
168-
169-
public get defaultTimestampFormat() {
170-
return this._defaultTimestampFormat;
171-
}
172-
173157
public get analyzeOnSettingChange(): boolean {
174158
return VscodeSettings.getInstance().analyzeOnSettingChange;
175159
}
@@ -237,23 +221,4 @@ export class ArduinoSettings implements IArduinoSettings {
237221
this._arduinoPath = configValue;
238222
}
239223
}
240-
241-
private async tryGetDefaultBaudRate(): Promise<void> {
242-
const supportBaudRates = [300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 74880, 115200, 230400, 250000];
243-
const configValue = VscodeSettings.getInstance().defaultBaudRate;
244-
if (!configValue || supportBaudRates.indexOf(configValue) === -1) {
245-
this._defaultBaudRate = 0;
246-
} else {
247-
this._defaultBaudRate = configValue;
248-
}
249-
}
250-
251-
private async tryGetDefaultTimestampFormat(): Promise<void> {
252-
const configValue = VscodeSettings.getInstance().defaultTimestampFormat;
253-
if (!configValue) {
254-
this._defaultTimestampFormat = "";
255-
} else {
256-
this._defaultTimestampFormat = configValue;
257-
}
258-
}
259224
}

src/arduino/vscodeSettings.ts

-12
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ const configKeys = {
1616
DISABLE_TESTING_OPEN: "arduino.disableTestingOpen",
1717
IGNORE_BOARDS: "arduino.ignoreBoards",
1818
SKIP_HEADER_PROVIDER: "arduino.skipHeaderProvider",
19-
DEFAULT_BAUD_RATE: "arduino.defaultBaudRate",
2019
USE_ARDUINO_CLI: "arduino.useArduinoCli",
2120
DISABLE_INTELLISENSE_AUTO_GEN: "arduino.disableIntelliSenseAutoGen",
22-
DEFAULT_TIMESTAMP_FORMAT: "arduino.defaultTimestampFormat",
2321
ANALYZE_ON_OPEN: "arduino.analyzeOnOpen",
2422
ANALYZE_ON_SETTING_CHANGE: "arduino.analyzeOnSettingChange",
2523
};
@@ -35,10 +33,8 @@ export interface IVscodeSettings {
3533
disableTestingOpen: boolean;
3634
ignoreBoards: string[];
3735
skipHeaderProvider: boolean;
38-
defaultBaudRate: number;
3936
useArduinoCli: boolean;
4037
disableIntelliSenseAutoGen: boolean;
41-
defaultTimestampFormat: string;
4238
analyzeOnOpen: boolean;
4339
analyzeOnSettingChange: boolean;
4440
updateAdditionalUrls(urls: string[]): void;
@@ -108,10 +104,6 @@ export class VscodeSettings implements IVscodeSettings {
108104
this.setConfigValue(configKeys.IGNORE_BOARDS, value, true);
109105
}
110106

111-
public get defaultBaudRate(): number {
112-
return this.getConfigValue<number>(configKeys.DEFAULT_BAUD_RATE);
113-
}
114-
115107
public get useArduinoCli(): boolean {
116108
return this.getConfigValue<boolean>(configKeys.USE_ARDUINO_CLI);
117109
}
@@ -124,10 +116,6 @@ export class VscodeSettings implements IVscodeSettings {
124116
return this.getConfigValue<boolean>(configKeys.DISABLE_INTELLISENSE_AUTO_GEN);
125117
}
126118

127-
public get defaultTimestampFormat(): string {
128-
return this.getConfigValue<string>(configKeys.DEFAULT_TIMESTAMP_FORMAT);
129-
}
130-
131119
public get analyzeOnOpen(): boolean {
132120
return this.getConfigValue<boolean>(configKeys.ANALYZE_ON_OPEN);
133121
}

src/common/constants.ts

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ export const messages = {
4141
export const statusBarPriority = {
4242
PORT: 20,
4343
OPEN_PORT: 30,
44-
BAUD_RATE: 40,
45-
TIMESTAMP_FORMAT: 50,
4644
BOARD: 60,
4745
ENDING: 70,
4846
SKETCH: 80,

src/extension.ts

-3
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,6 @@ export async function activate(context: vscode.ExtensionContext) {
283283
context.subscriptions.push(serialMonitor);
284284
registerNonArduinoCommand("arduino.selectSerialPort", () => serialMonitor.selectSerialPort());
285285
registerNonArduinoCommand("arduino.openSerialMonitor", () => serialMonitor.openSerialMonitor());
286-
//registerNonArduinoCommand("arduino.changeBaudRate", () => serialMonitor.changeBaudRate());
287-
//registerNonArduinoCommand("arduino.changeTimestampFormat", () => serialMonitor.changeTimestampFormat());
288-
//registerNonArduinoCommand("arduino.sendMessageToSerialPort", () => serialMonitor.sendMessageToSerialPort());
289286
registerNonArduinoCommand("arduino.closeSerialMonitor", (port) => serialMonitor.closeSerialMonitor(port));
290287

291288
const completionProvider = new completionProviderModule.CompletionProvider();

0 commit comments

Comments
 (0)