Skip to content

Commit 3abc3f3

Browse files
laurensvalkdlech
authored andcommitted
usb/sagas: Don't reset USB device.
This operation does not work on Windows, and does not appear to be crucial on other platforms either. The browser seems to already handle resetting the endpoints as needed when connecting or closing the browser (at least on Linux)
1 parent 7a415e7 commit 3abc3f3

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/usb/sagas.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,6 @@ function* handleUsbConnectPybricks(hotPlugDevice?: USBDevice): Generator {
151151

152152
exitStack.push(() => usbDevice.close().catch(console.debug));
153153

154-
// Always reset the USB device to ensure it is in a known state.
155-
const [, resetErr] = yield* call(() => maybe(usbDevice.reset()));
156-
if (resetErr) {
157-
// TODO: show error message to user here
158-
console.error('Failed to reset USB device:', resetErr);
159-
yield* put(usbDidFailToConnectPybricks());
160-
yield* cleanup();
161-
return;
162-
}
163-
164154
const [, selectErr] = yield* call(() => maybe(usbDevice.selectConfiguration(1)));
165155
if (selectErr) {
166156
// TODO: show error message to user here

0 commit comments

Comments
 (0)