mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-15 02:54:07 +00:00
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)
This commit is contained in:
committed by
David Lechner
parent
7a415e7c85
commit
3abc3f3b52
@@ -151,16 +151,6 @@ function* handleUsbConnectPybricks(hotPlugDevice?: USBDevice): Generator {
|
||||
|
||||
exitStack.push(() => usbDevice.close().catch(console.debug));
|
||||
|
||||
// Always reset the USB device to ensure it is in a known state.
|
||||
const [, resetErr] = yield* call(() => maybe(usbDevice.reset()));
|
||||
if (resetErr) {
|
||||
// TODO: show error message to user here
|
||||
console.error('Failed to reset USB device:', resetErr);
|
||||
yield* put(usbDidFailToConnectPybricks());
|
||||
yield* cleanup();
|
||||
return;
|
||||
}
|
||||
|
||||
const [, selectErr] = yield* call(() => maybe(usbDevice.selectConfiguration(1)));
|
||||
if (selectErr) {
|
||||
// TODO: show error message to user here
|
||||
|
||||
Reference in New Issue
Block a user