Remove blocking option from USB connect

Remove the option to block in USBDevice::connect since this
should be handled at a higher level. Also call init to ensure that
the USBDevice has been initalized.
feature-hal-spec-usb-device
Russ Butler 2018-04-30 18:57:24 -05:00 committed by Russ Butler
parent 3c46367634
commit 7df887fe69
2 changed files with 8 additions and 10 deletions

View File

@ -994,20 +994,20 @@ bool USBDevice::configured()
return ret; return ret;
} }
void USBDevice::connect(bool blocking) void USBDevice::connect()
{ {
/* Connect device */
lock(); lock();
/* Ensure device has been initialized */
init();
/* Connect device */
if (!_connected) { if (!_connected) {
_phy->connect(); _phy->connect();
_connected = true; _connected = true;
} }
unlock();
if (blocking) { unlock();
/* Block if not configured */
while (!configured());
}
} }
void USBDevice::disconnect() void USBDevice::disconnect()

View File

@ -117,10 +117,8 @@ public:
/** /**
* Connect a device * Connect a device
*
* @param blocking: block if not configured
*/ */
void connect(bool blocking = true); void connect();
/** /**
* Disconnect a device * Disconnect a device