diff --git a/usb/device/USBDevice/USBDevice.cpp b/usb/device/USBDevice/USBDevice.cpp index fdc49a83ea..c539e5a598 100644 --- a/usb/device/USBDevice/USBDevice.cpp +++ b/usb/device/USBDevice/USBDevice.cpp @@ -994,20 +994,20 @@ bool USBDevice::configured() return ret; } -void USBDevice::connect(bool blocking) +void USBDevice::connect() { - /* Connect device */ lock(); + + /* Ensure device has been initialized */ + init(); + + /* Connect device */ if (!_connected) { _phy->connect(); _connected = true; } - unlock(); - if (blocking) { - /* Block if not configured */ - while (!configured()); - } + unlock(); } void USBDevice::disconnect() diff --git a/usb/device/USBDevice/USBDevice.h b/usb/device/USBDevice/USBDevice.h index 91bb751336..c6056059bb 100644 --- a/usb/device/USBDevice/USBDevice.h +++ b/usb/device/USBDevice/USBDevice.h @@ -117,10 +117,8 @@ public: /** * Connect a device - * - * @param blocking: block if not configured */ - void connect(bool blocking = true); + void connect(); /** * Disconnect a device