mirror of https://github.com/ARMmbed/mbed-os.git
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
parent
3c46367634
commit
7df887fe69
|
@ -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()
|
||||
|
|
|
@ -117,10 +117,8 @@ public:
|
|||
|
||||
/**
|
||||
* Connect a device
|
||||
*
|
||||
* @param blocking: block if not configured
|
||||
*/
|
||||
void connect(bool blocking = true);
|
||||
void connect();
|
||||
|
||||
/**
|
||||
* Disconnect a device
|
||||
|
|
Loading…
Reference in New Issue