diff --git a/src/dap/adi.ts b/src/dap/adi.ts index b72610c..e7b782e 100644 --- a/src/dap/adi.ts +++ b/src/dap/adi.ts @@ -172,38 +172,38 @@ export class ADI implements DAP { protected readMem8Command(register: number): DAPOperation[] { return this.writeAPCommand(APRegister.CSW, CSWMask.VALUE | CSWMask.SIZE_8) - .concat(this.writeAPCommand(APRegister.TAR, register)) - .concat(this.readAPCommand(APRegister.DRW)); + .concat(this.writeAPCommand(APRegister.TAR, register)) + .concat(this.readAPCommand(APRegister.DRW)); } protected writeMem8Command(register: number, value: number): DAPOperation[] { return this.writeAPCommand(APRegister.CSW, CSWMask.VALUE | CSWMask.SIZE_8) - .concat(this.writeAPCommand(APRegister.TAR, register)) - .concat(this.writeAPCommand(APRegister.DRW, value)); + .concat(this.writeAPCommand(APRegister.TAR, register)) + .concat(this.writeAPCommand(APRegister.DRW, value)); } protected readMem16Command(register: number): DAPOperation[] { return this.writeAPCommand(APRegister.CSW, CSWMask.VALUE | CSWMask.SIZE_16) - .concat(this.writeAPCommand(APRegister.TAR, register)) - .concat(this.readAPCommand(APRegister.DRW)); + .concat(this.writeAPCommand(APRegister.TAR, register)) + .concat(this.readAPCommand(APRegister.DRW)); } protected writeMem16Command(register: number, value: number): DAPOperation[] { return this.writeAPCommand(APRegister.CSW, CSWMask.VALUE | CSWMask.SIZE_16) - .concat(this.writeAPCommand(APRegister.TAR, register)) - .concat(this.writeAPCommand(APRegister.DRW, value)); + .concat(this.writeAPCommand(APRegister.TAR, register)) + .concat(this.writeAPCommand(APRegister.DRW, value)); } protected readMem32Command(register: number): DAPOperation[] { return this.writeAPCommand(APRegister.CSW, CSWMask.VALUE | CSWMask.SIZE_32) - .concat(this.writeAPCommand(APRegister.TAR, register)) - .concat(this.readAPCommand(APRegister.DRW)); + .concat(this.writeAPCommand(APRegister.TAR, register)) + .concat(this.readAPCommand(APRegister.DRW)); } protected writeMem32Command(register: number, value: number): DAPOperation[] { return this.writeAPCommand(APRegister.CSW, CSWMask.VALUE | CSWMask.SIZE_32) - .concat(this.writeAPCommand(APRegister.TAR, register)) - .concat(this.writeAPCommand(APRegister.DRW, value as number)); + .concat(this.writeAPCommand(APRegister.TAR, register)) + .concat(this.writeAPCommand(APRegister.DRW, value as number)); } protected async transferSequence(operations: DAPOperation[][]): Promise { @@ -382,7 +382,7 @@ export class ADI implements DAP { protected async readMem32Sequence(register: number, count: number): Promise { await this.transferSequence([ this.writeAPCommand(APRegister.CSW, CSWMask.VALUE | CSWMask.SIZE_32), - this.writeAPCommand(APRegister.TAR, register), + this.writeAPCommand(APRegister.TAR, register) ]); const results: Uint32Array[] = []; @@ -408,7 +408,7 @@ export class ADI implements DAP { protected async writeMem32Sequence(register: number, values: Uint32Array): Promise { await this.transferSequence([ this.writeAPCommand(APRegister.CSW, CSWMask.VALUE | CSWMask.SIZE_32), - this.writeAPCommand(APRegister.TAR, register), + this.writeAPCommand(APRegister.TAR, register) ]); // Split values into chunks no longer than block size diff --git a/src/daplink/index.ts b/src/daplink/index.ts index 74864ab..5687887 100644 --- a/src/daplink/index.ts +++ b/src/daplink/index.ts @@ -80,7 +80,7 @@ export class DAPLink extends CmsisDAP { constructor(transport: Transport, mode: DAPProtocol = DAPProtocol.DEFAULT, clockFrequency: number = DEFAULT_CLOCK_FREQUENCY) { super(transport, mode, clockFrequency); - this.on('newListener', async event => { + this.on('newListener', event => { if (event === DAPLink.EVENT_SERIAL_DATA) { const listenerCount = this.listenerCount(event); diff --git a/src/processor/cortex-m.ts b/src/processor/cortex-m.ts index 0fe7ad0..9fc641e 100644 --- a/src/processor/cortex-m.ts +++ b/src/processor/cortex-m.ts @@ -60,13 +60,13 @@ export class CortexM extends ADI implements Processor { protected readCoreRegisterCommand(register: number): DAPOperation[] { return this.writeMem32Command(DebugRegister.DCRSR, register) - .concat(this.readMem32Command(DebugRegister.DHCSR)) - .concat(this.readMem32Command(DebugRegister.DCRDR)); + .concat(this.readMem32Command(DebugRegister.DHCSR)) + .concat(this.readMem32Command(DebugRegister.DCRDR)); } protected writeCoreRegisterCommand(register: number, value: number): DAPOperation[] { return this.writeMem32Command(DebugRegister.DCRDR, value) - .concat(this.writeMem32Command(DebugRegister.DCRSR, register | DcrsrMask.REGWnR)); + .concat(this.writeMem32Command(DebugRegister.DCRSR, register | DcrsrMask.REGWnR)); } /** diff --git a/src/proxy/enums.ts b/src/proxy/enums.ts index 406f5a3..3c45e80 100644 --- a/src/proxy/enums.ts +++ b/src/proxy/enums.ts @@ -260,7 +260,7 @@ export const enum DAPInfoRequest { */ export const enum DAPHostStatusType { /** - * Connect: Status indicates that the debugger is connected to the Debug Unit + * Connect: Status indicates that the debugger is connected to the Debug Unit */ CONNECT = 0, /** diff --git a/src/transport/usb.ts b/src/transport/usb.ts index dd095af..f27aa4f 100644 --- a/src/transport/usb.ts +++ b/src/transport/usb.ts @@ -117,7 +117,7 @@ export class USB implements Transport { public async open(): Promise { this.device.open(); - await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { this.device.setConfiguration(this.configuration, error => { if (error) { reject(new Error(error)); @@ -236,7 +236,7 @@ export class USB implements Transport { const extended = this.extendBuffer(data, this.packetSize); const buffer = this.bufferSourceToBuffer(extended); - await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { // Use endpoint if it exists if (this.endpointOut) { this.endpointOut.transfer(buffer, exception => {