Skip to content

Commit f41923a

Browse files
committed
Add command to read serial settings
1 parent 81addf6 commit f41923a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/dap/dap.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,19 @@ export class DAP {
182182
return buf;
183183
}
184184

185+
public async readSerialSettings() {
186+
return this.dap.cmdNums(DapCmd.DAP_VENDOR1, []);
187+
}
188+
185189
public async initializeSerial(data: number[]) {
186-
return this.dap.cmdNums(DapCmd.DAP_VENDOR1, data);
190+
return this.dap.cmdNums(DapCmd.DAP_VENDOR2, data);
187191
}
188192

189193
public async readSerial() {
190-
return this.dap.cmdNums(DapCmd.DAP_VENDOR2, []);
194+
return this.dap.cmdNums(DapCmd.DAP_VENDOR3, []);
191195
}
192196

193197
public async writeSerial(data: number[]) {
194-
return this.dap.cmdNums(DapCmd.DAP_VENDOR3, data);
198+
return this.dap.cmdNums(DapCmd.DAP_VENDOR4, data);
195199
}
196200
}

src/serial/serial.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export class Serial {
3333
}, this.delay);
3434
}
3535

36+
public async getSerialSettings() {
37+
return this.dap.readSerialSettings();
38+
}
39+
3640
public async stop() {
3741
if (this.timer) {
3842
clearInterval(this.timer);

0 commit comments

Comments
 (0)