From 536018077c02a195048ceccf37ea097e557dda7d Mon Sep 17 00:00:00 2001 From: Grace Date: Mon, 5 Aug 2024 10:55:13 +0100 Subject: [PATCH] Add software reset to serial state change queue --- lib/usb.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/usb.ts b/lib/usb.ts index f7c192f..5be6b4f 100644 --- a/lib/usb.ts +++ b/lib/usb.ts @@ -384,7 +384,9 @@ export class MicrobitWebUSBConnection } async softwareReset(): Promise { - await this.connection?.softwareReset(); + return this.serialStateChangeQueue.add( + async () => await this.connection?.softwareReset(), + ); } private handleDisconnect = (event: USBConnectionEvent) => {