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;
|
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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue